Skip to content

Commit 6b01d73

Browse files
committed
Fix Compiler Error C2719 in x86/Win32 compilation with Visual Studio on Windows.
1 parent b91c89f commit 6b01d73

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

RadeonRays/src/accelerator/bvh2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ namespace RadeonRays
142142
}
143143

144144
void Bvh2::BuildImpl(
145-
__m128 scene_min,
146-
__m128 scene_max,
147-
__m128 centroid_scene_min,
148-
__m128 centroid_scene_max,
145+
__m128 MSVC_X86_ALIGNMENT_FIX scene_min,
146+
__m128 MSVC_X86_ALIGNMENT_FIX scene_max,
147+
__m128 MSVC_X86_ALIGNMENT_FIX centroid_scene_min,
148+
__m128 MSVC_X86_ALIGNMENT_FIX centroid_scene_max,
149149
const float3 *aabb_min,
150150
const float3 *aabb_max,
151151
const float3 *aabb_centroid,

RadeonRays/src/accelerator/bvh2.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,21 @@ namespace RadeonRays
115115
#endif // WIN32
116116
}
117117

118+
#if defined(_MSC_VER)
119+
#if defined(_WIN32)
120+
#if defined(_WIN64)
121+
#define MSVC_X86_ALIGNMENT_FIX
122+
#else
123+
#define MSVC_X86_ALIGNMENT_FIX &
124+
#endif
125+
#endif
126+
#endif
127+
118128
void BuildImpl(
119-
__m128 scene_min,
120-
__m128 scene_max,
121-
__m128 centroid_scene_min,
122-
__m128 centroid_scene_max,
129+
__m128 MSVC_X86_ALIGNMENT_FIX scene_min,
130+
__m128 MSVC_X86_ALIGNMENT_FIX scene_max,
131+
__m128 MSVC_X86_ALIGNMENT_FIX centroid_scene_min,
132+
__m128 MSVC_X86_ALIGNMENT_FIX centroid_scene_max,
123133
const float3 *aabb_min,
124134
const float3 *aabb_max,
125135
const float3 *aabb_centroid,

0 commit comments

Comments
 (0)