From 5569274a97f8b18c0e1ed5590aa12b54c726e659 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 12 Nov 2024 18:51:11 +0100 Subject: [PATCH] [d3d9] Do not assume 16-byte alignment in replaceNaN Stack alignment is 4 bytes on 32-bit, and we cannot align variables on the stack, so this is technically broken. --- src/util/util_vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/util_vector.h b/src/util/util_vector.h index 08fea02f2..b0ae47ddd 100644 --- a/src/util/util_vector.h +++ b/src/util/util_vector.h @@ -152,11 +152,11 @@ namespace dxvk { inline Vector4 replaceNaN(Vector4 a) { #ifdef DXVK_ARCH_X86 - alignas(16) Vector4 result; + Vector4 result; __m128 value = _mm_loadu_ps(a.data); __m128 mask = _mm_cmpeq_ps(value, value); value = _mm_and_ps(value, mask); - _mm_store_ps(result.data, value); + _mm_storeu_ps(result.data, value); return result; #else for (int i = 0; i < 4; i++)