From 9c12eb245ebbf568b6eb7b838cf350aa9f729497 Mon Sep 17 00:00:00 2001
From: Petar Popovic <[EMAIL REDACTED]>
Date: Wed, 5 Aug 2026 01:39:02 +0200
Subject: [PATCH] Update MIX_Track::position3d alignment and assertion
---
src/SDL_mixer_internal.h | 2 +-
src/SDL_mixer_spatialization.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/SDL_mixer_internal.h b/src/SDL_mixer_internal.h
index bccb5b38..3124e23e 100644
--- a/src/SDL_mixer_internal.h
+++ b/src/SDL_mixer_internal.h
@@ -137,7 +137,7 @@ struct MIX_Audio
struct MIX_Track
{
- float SDL_ALIGNED(16) position3d[4]; // we only need the X, Y, and Z coords, but the 4th element makes this SIMD-friendly.
+ float position3d[4]; // we only need the X, Y, and Z coords, but the 4th element makes this SIMD-friendly.
MIX_SpatializationMode spatialization_mode;
float spatialization_panning[2];
int spatialization_speakers[2];
diff --git a/src/SDL_mixer_spatialization.c b/src/SDL_mixer_spatialization.c
index d5df3eb5..c48eb850 100644
--- a/src/SDL_mixer_spatialization.c
+++ b/src/SDL_mixer_spatialization.c
@@ -410,7 +410,7 @@ void MIX_Spatialize(const MIX_VBAP2D *vbap2d, const float *position, float *pann
{
const int output_channels = vbap2d->speaker_count;
- SDL_assert( (((size_t) position) % 16) == 0 ); // must be aligned for SIMD access.
+ SDL_assert( (((size_t) position) % SDL_GetSIMDAlignment()) == 0 ); // must be aligned for SIMD access.
SDL_assert(output_channels > 0);
float gain, radians;