Skip to content

Commit

Permalink
Revert "Sanity: initialize renderer list in the main thread"
Browse files Browse the repository at this point in the history
This reverts commit fdc8806.
  • Loading branch information
Xottab-DUTY committed Jan 21, 2025
1 parent 4d7780b commit f8530cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/xrEngine/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/EngineAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
Expand Down
12 changes: 12 additions & 0 deletions src/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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();

Expand Down

0 comments on commit f8530cd

Please sign in to comment.