Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix freeze-crash in lightmapper under MinGW-GCC (3.2) #45380

Merged
merged 1 commit into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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