Skip to content

Commit

Permalink
Sanity: initialize renderer list in the main thread
Browse files Browse the repository at this point in the history
It turned out that it crashes sometimes on some systems.
(two users with AMD CPU and Nvidia RTX GPU reported the same crash)

This reverts commit 5673c55
  • Loading branch information
Xottab-DUTY committed Dec 27, 2024
1 parent acbd404 commit fdc8806
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/xrEngine/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ 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();
void CreateRendererList(); // Better to call it in the main thread
void Initialize(GameModule* game);
void Destroy();
};
Expand Down
12 changes: 0 additions & 12 deletions src/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,6 @@ 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 @@ -270,11 +263,6 @@ 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 fdc8806

Please sign in to comment.