Skip to content

Commit

Permalink
[util] replaceNaN: Align result
Browse files Browse the repository at this point in the history
Otherwise _mm_store_ps can fail
  • Loading branch information
AlpyneDreams authored and misyltoad committed Jul 3, 2023
1 parent 3a368f4 commit 026aa49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/util_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace dxvk {

inline Vector4 replaceNaN(Vector4 a) {
#ifdef DXVK_ARCH_X86
Vector4 result;
alignas(16) Vector4 result;

This comment has been minimized.

Copy link
@doitsujin

doitsujin Jul 20, 2023

Owner

Is there any platform with less than 16 bytes of stack alignment?

This comment has been minimized.

Copy link
@misyltoad

misyltoad Jul 20, 2023

Collaborator

Old linux x86

__m128 value = _mm_loadu_ps(a.data);
__m128 mask = _mm_cmpeq_ps(value, value);
value = _mm_and_ps(value, mask);
Expand Down

0 comments on commit 026aa49

Please sign in to comment.