Skip to content

Commit b8cb425

Browse files
committed
Disable multithreaded texture loading for OpenGL renderer
1 parent 3dd786b commit b8cb425

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Layers/xrRender/ResourceManager.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ void CResourceManager::Delete(const Shader* S)
341341
Msg("! ERROR: Failed to find complete shader");
342342
}
343343

344+
#ifndef USE_OGL
344345
xr_vector<CTexture*> textures_to_load;
345346

346347
void LoadTextures(const size_t thread_num, const size_t textures_per_worker)
@@ -366,6 +367,7 @@ void LoadTextures(const size_t thread_num, const size_t textures_per_worker)
366367
Msg("Thread %d, texture loading time = %d", thread_num, timer.GetElapsed_ms());
367368
#endif
368369
}
370+
#endif
369371

370372
void CResourceManager::DeferredUpload()
371373
{
@@ -379,6 +381,7 @@ void CResourceManager::DeferredUpload()
379381
timer.Start();
380382
#endif
381383

384+
#ifndef USE_OGL
382385
const auto nWorkers = ttapi.threads.size();
383386
const auto textures_per_worker = m_textures.size() / nWorkers;
384387

@@ -391,6 +394,10 @@ void CResourceManager::DeferredUpload()
391394
ttapi.wait();
392395

393396
textures_to_load.clear();
397+
#else
398+
for (auto& texture : m_textures)
399+
texture.second->Load();
400+
#endif
394401

395402
#ifndef MASTER_GOLD
396403
Msg("%s, texture loading time = %d", __FUNCTION__, timer.GetElapsed_ms());

0 commit comments

Comments
 (0)