mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
Add checks for __SSE2__ in the lightmap raycaster
(cherry picked from commit 20717990fd
)
This commit is contained in:
parent
31a9afb135
commit
1cab622e94
@ -32,7 +32,9 @@
|
||||
|
||||
#include "lightmap_raycaster.h"
|
||||
|
||||
#ifdef __SSE2__
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
|
||||
LightmapRaycaster *LightmapRaycasterEmbree::create_embree_raycaster() {
|
||||
return memnew(LightmapRaycasterEmbree);
|
||||
@ -171,8 +173,10 @@ void embree_error_handler(void *p_user_data, RTCError p_code, const char *p_str)
|
||||
}
|
||||
|
||||
LightmapRaycasterEmbree::LightmapRaycasterEmbree() {
|
||||
#ifdef __SSE2__
|
||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
||||
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
|
||||
#endif
|
||||
|
||||
embree_device = rtcNewDevice(nullptr);
|
||||
rtcSetDeviceErrorFunction(embree_device, &embree_error_handler, nullptr);
|
||||
@ -180,8 +184,10 @@ LightmapRaycasterEmbree::LightmapRaycasterEmbree() {
|
||||
}
|
||||
|
||||
LightmapRaycasterEmbree::~LightmapRaycasterEmbree() {
|
||||
#ifdef __SSE2__
|
||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF);
|
||||
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_OFF);
|
||||
#endif
|
||||
|
||||
if (embree_scene != nullptr) {
|
||||
rtcReleaseScene(embree_scene);
|
||||
|
Loading…
Reference in New Issue
Block a user