mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Write out a warning if std:🧵:hardware_concurrency returns zero.
- If the number of cores cannot be determined, turn of multithreading in the software renderer as it is most likely a low end system
This commit is contained in:
parent
7e998c2261
commit
7727263599
2 changed files with 11 additions and 2 deletions
|
@ -151,7 +151,7 @@ void PolyRenderThreads::RenderThreadSlices(int totalcount, std::function<void(Po
|
|||
|
||||
int numThreads = std::thread::hardware_concurrency();
|
||||
if (numThreads == 0)
|
||||
numThreads = 4;
|
||||
numThreads = 1;
|
||||
|
||||
if (r_scene_multithreaded == 0 || r_multithreaded == 0)
|
||||
numThreads = 1;
|
||||
|
|
|
@ -200,7 +200,16 @@ namespace swrenderer
|
|||
{
|
||||
int numThreads = std::thread::hardware_concurrency();
|
||||
if (numThreads == 0)
|
||||
numThreads = 4;
|
||||
{
|
||||
static bool firstCall = true;
|
||||
if (firstCall)
|
||||
{
|
||||
firstCall = false;
|
||||
Printf("Warning: Unable to determine number of CPU cores/threads for this computer. To improve performance, please type 'r_multithreaded x' in the console, where x is the number of threads to use.\n");
|
||||
}
|
||||
|
||||
numThreads = 1;
|
||||
}
|
||||
|
||||
if (r_scene_multithreaded == 0 || r_multithreaded == 0)
|
||||
numThreads = 1;
|
||||
|
|
Loading…
Reference in a new issue