diff --git a/src/xrEngine/Engine.cpp b/src/xrEngine/Engine.cpp index 85db38de84e..277b90bba4c 100644 --- a/src/xrEngine/Engine.cpp +++ b/src/xrEngine/Engine.cpp @@ -75,7 +75,6 @@ void CEngine::Initialize(GameModule* game) Device.seqFrame.Add(&g_sound_processor, REG_PRIORITY_NORMAL - 1000); // Place it after Level update Device.seqFrameMT.Add(&g_sound_renderer); - External.CreateRendererList(); CheckAndSetupRenderer(); External.Initialize(game); diff --git a/src/xrEngine/EngineAPI.h b/src/xrEngine/EngineAPI.h index 09e79f5ae90..d3e6416a9a5 100644 --- a/src/xrEngine/EngineAPI.h +++ b/src/xrEngine/EngineAPI.h @@ -76,7 +76,7 @@ class ENGINE_API CEngineAPI CEngineAPI(); ~CEngineAPI(); - void CreateRendererList(); // Better to call it in the main thread + void CreateRendererList(); void Initialize(GameModule* game); void Destroy(); }; diff --git a/src/xrEngine/x_ray.cpp b/src/xrEngine/x_ray.cpp index 68721c52da1..640fe5c1a3c 100644 --- a/src/xrEngine/x_ray.cpp +++ b/src/xrEngine/x_ray.cpp @@ -245,6 +245,13 @@ CApplication::CApplication(pcstr commandLine, GameModule* game) Engine.Sound.CreateDevicesList(); }); +#ifdef XR_PLATFORM_WINDOWS + const auto& createRendererList = TaskManager::AddTask([] + { + Engine.External.CreateRendererList(); + }); +#endif + pcstr fsltx = "-fsltx "; string_path fsgame = ""; if (strstr(commandLine, fsltx)) @@ -268,6 +275,11 @@ CApplication::CApplication(pcstr commandLine, GameModule* game) TaskScheduler->Wait(inputTask); InitConsole(); +#ifdef XR_PLATFORM_WINDOWS + TaskScheduler->Wait(createRendererList); +#else + Engine.External.CreateRendererList(); +#endif Engine.Initialize(game); Device.Initialize();