Skip to content
Permalink
Browse files

- disabled usage of intrinsics on non-Intel platforms

  • Loading branch information...
alexey-lysiuk committed Feb 4, 2019
1 parent 2765159 commit 8892cb619d31975394acf12b5ff52931082789e6
Showing with 8 additions and 0 deletions.
  1. +3 −0 src/CMakeLists.txt
  2. +5 −0 src/hwrenderer/scene/hw_bsp.cpp
@@ -36,6 +36,9 @@ if( ${ZDOOM_TARGET_ARCH} MATCHES "x86_64" )
set( X64 64 )
endif()

if( X64 OR ${ZDOOM_TARGET_ARCH} MATCHES "i386" )
add_definitions( -DARCH_IA32 )
endif()

if( NOT ZDOOM_LIBS )
set( ZDOOM_LIBS "" )
@@ -40,7 +40,10 @@
#include "hwrenderer/scene/hw_portal.h"
#include "hwrenderer/utility/hw_clock.h"
#include "hwrenderer/data/flatvertices.h"

#ifdef ARCH_IA32
#include <immintrin.h>
#endif // ARCH_IA32

CVAR(Bool, gl_multithread, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

@@ -106,6 +109,7 @@ void HWDrawInfo::WorkerThread()
auto job = jobQueue.GetJob();
if (job == nullptr)
{
#ifdef ARCH_IA32
// The queue is empty. But yielding would be too costly here and possibly cause further delays down the line if the thread is halted.
// So instead add a few pause instructions and retry immediately.
_mm_pause();
@@ -118,6 +122,7 @@ void HWDrawInfo::WorkerThread()
_mm_pause();
_mm_pause();
_mm_pause();
#endif // ARCH_IA32
}
// Note that the main thread MUST have prepared the fake sectors that get used below!
// This worker thread cannot prepare them itself without costly synchronization.

0 comments on commit 8892cb6

Please sign in to comment.
You can’t perform that action at this time.