Merge pull request #45380 from RandomShaper/lightmapper_fix_3.2

Fix freeze-crash in lightmapper under MinGW-GCC (3.2)
This commit is contained in:
Rémi Verschelde 2021-01-25 21:47:49 +01:00 committed by GitHub
commit 934b174d33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 --
}
/* 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 --
}
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 --
}
}

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();