- Missed some things regarding software threads.

(with help from dpJudas)
This commit is contained in:
drfrag 2019-05-09 23:23:25 +02:00
parent 8c81888471
commit ab24128049
3 changed files with 5 additions and 4 deletions

View file

@ -147,7 +147,7 @@ void PolyRenderThreads::RenderThreadSlices(int totalcount, std::function<void(Po
int numThreads = std::thread::hardware_concurrency();
if (numThreads == 0)
numThreads = 4;
numThreads = 2;
if (r_scene_multithreaded == 0 || r_multithreaded == 0)
numThreads = 1;

View file

@ -174,11 +174,12 @@ void DrawerThreads::StartThreads()
{
std::unique_lock<std::mutex> lock(threads_mutex);
int num_threads = std::thread::hardware_concurrency();
static int num_threads = std::thread::hardware_concurrency();
if (num_threads == 0)
{
num_threads = 2;
Printf ("Could not determine number of CPU cores (assuming 2). Set r_multithreaded.\n");
if (r_multithreaded == 1)
Printf ("Could not determine number of CPU cores (assuming 2). Set r_multithreaded.\n");
}
if (r_multithreaded == 0)

View file

@ -211,7 +211,7 @@ namespace swrenderer
{
int numThreads = std::thread::hardware_concurrency();
if (numThreads == 0)
numThreads = 4;
numThreads = 2;
if (r_scene_multithreaded == 0 || r_multithreaded == 0)
numThreads = 1;