Skip to content

Commit

Permalink
Merge pull request #45380 from RandomShaper/lightmapper_fix_3.2
Browse files Browse the repository at this point in the history
Fix freeze-crash in lightmapper under MinGW-GCC (3.2)
  • Loading branch information
akien-mga authored Jan 25, 2021
2 parents 16b30f9 + 0f4c44c commit 934b174
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 44 deletions.
16 changes: 1 addition & 15 deletions thirdparty/embree/common/sys/intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down
22 changes: 2 additions & 20 deletions thirdparty/embree/common/sys/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
}

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/embree/common/sys/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
#define dll_import
#endif

#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__MINGW32__)
#if !defined(__noinline)
#define __noinline __declspec(noinline)
#endif
Expand Down
8 changes: 0 additions & 8 deletions thirdparty/embree/common/tasking/taskschedulerinternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 934b174

Please sign in to comment.