Fix speed regression caused by the DrawerThread object being recreated every frame

This commit is contained in:
Magnus Norddahl 2017-01-03 04:29:06 +01:00
parent 3e59ebb48d
commit 4125da9fc3
2 changed files with 2 additions and 12 deletions

View File

@ -114,7 +114,7 @@ void DrawerCommandQueue::Finish()
// Do one thread ourselves:
DrawerThread thread;
static DrawerThread thread;
thread.core = 0;
thread.num_cores = (int)(queue->threads.size() + 1);

View File

@ -202,17 +202,7 @@ public:
if (queue->threaded_render == 0 || !r_multithreaded)
{
T command(std::forward<Types>(args)...);
VectoredTryCatch(&command,
[](void *data)
{
T *c = (T*)data;
c->Execute(&Instance()->single_core_thread);
},
[](void *data, const char *reason, bool fatal)
{
T *c = (T*)data;
ReportDrawerError(c, false, reason, fatal);
});
command.Execute(&Instance()->single_core_thread);
}
else
{