- add support for specifying the exact thread count to r_multithreaded and r_scene_multithreaded

This commit is contained in:
Magnus Norddahl 2018-07-28 04:57:23 +02:00
commit 990f02d7c5
5 changed files with 33 additions and 20 deletions

View file

@ -44,7 +44,7 @@
void PeekThreadedErrorPane();
#endif
EXTERN_CVAR(Bool, r_scene_multithreaded);
EXTERN_CVAR(Int, r_scene_multithreaded);
PolyRenderThread::PolyRenderThread(int threadIndex) : MainThread(threadIndex == 0), ThreadIndex(threadIndex)
{
@ -151,8 +151,10 @@ void PolyRenderThreads::RenderThreadSlices(int totalcount, std::function<void(Po
if (numThreads == 0)
numThreads = 4;
if (!r_scene_multithreaded || !r_multithreaded)
if (r_scene_multithreaded == 0 || r_multithreaded == 0)
numThreads = 1;
else if (r_scene_multithreaded != 1)
numThreads = r_scene_multithreaded;
if (numThreads != (int)Threads.size())
{