mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 04:54:15 +01:00
[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.
This commit is contained in:
parent
8dc1fe1262
commit
369ee23645
@ -152,11 +152,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
inline Vector4 replaceNaN(Vector4 a) {
|
inline Vector4 replaceNaN(Vector4 a) {
|
||||||
#ifdef DXVK_ARCH_X86
|
#ifdef DXVK_ARCH_X86
|
||||||
alignas(16) Vector4 result;
|
Vector4 result;
|
||||||
__m128 value = _mm_loadu_ps(a.data);
|
__m128 value = _mm_loadu_ps(a.data);
|
||||||
__m128 mask = _mm_cmpeq_ps(value, value);
|
__m128 mask = _mm_cmpeq_ps(value, value);
|
||||||
value = _mm_and_ps(value, mask);
|
value = _mm_and_ps(value, mask);
|
||||||
_mm_store_ps(result.data, value);
|
_mm_storeu_ps(result.data, value);
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user