Fix freeze-crash in lightmapper under MinGW-GCC

This commit is contained in:
Pedro J. Estébanez 2021-01-23 05:53:10 +01:00
parent 2d904127d6
commit 0f4c44c9fb
4 changed files with 4 additions and 44 deletions

View file

@ -11,12 +11,6 @@
#include <immintrin.h>
// -- GODOT start --
#if defined(__WIN32__) && defined(__MINGW32__)
#include <unistd.h>
#endif
// -- GODOT end --
#if defined(__BMI__) && defined(__GNUC__) && !defined(__INTEL_COMPILER)
#if !defined(_tzcnt_u32)
#define _tzcnt_u32 __tzcnt_u32
@ -425,16 +419,8 @@ namespace embree
__forceinline void pause_cpu(const size_t N = 8)
{
// -- GODOT start --
for (size_t i=0; i<N; i++)
#if !(defined(__WIN32__) && defined(__MINGW32__))
// -- GODOT end --
_mm_pause();
// -- GODOT start --
#else
__builtin_ia32_pause();
#endif
// -- GODOT end --
_mm_pause();
}
/* prefetches */

View file

@ -47,17 +47,8 @@ namespace embree
{
while (flag.load())
{
// -- GODOT start --
#if !(defined (__WIN32__) && defined (__MINGW32__))
// -- GODOT end --
_mm_pause();
_mm_pause();
// -- GODOT start --
#else
__builtin_ia32_pause();
__builtin_ia32_pause();
#endif
// -- GODOT end --
_mm_pause();
}
bool expected = false;
@ -83,17 +74,8 @@ namespace embree
{
while(flag.load())
{
// -- GODOT start --
#if !(defined (__WIN32__) && defined(__MINGW32__))
// -- GODOT end --
_mm_pause();
_mm_pause();
// -- GODOT start --
#else
__builtin_ia32_pause();
__builtin_ia32_pause();
#endif
// -- GODOT end --
_mm_pause();
}
}

View file

@ -91,7 +91,7 @@
#define dll_import
#endif
#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__MINGW32__)
#if !defined(__noinline)
#define __noinline __declspec(noinline)
#endif

View file

@ -361,15 +361,7 @@ namespace embree
if ((loopIndex % LOOP_YIELD_THRESHOLD) == 0)
yield();
else
// -- GODOT start --
#if !defined(__MINGW32__)
// -- GODOT end --
_mm_pause();
// -- GODOT start --
#else
__builtin_ia32_pause();
#endif
// -- GODOT end --
loopIndex++;
#else
yield();