SampleBrowser_d crashes due to uninitialized GpuProgramManager singleton

Description

The method GL3PlusRenderSystem::_createRenderWindow() gets executed during the sample browser's initialization stage. It runs two methods as part of normal control flow: createRenderSystemCapabilities() and initialiseFromRenderSystemCapabilities().

The problem is that createRenderSystemCapabilities() may execute GpuProgramManager::getSingleton() before the GL3PlusRenderSystem initializes the GpuProgramManager singleton in the call to initialiseFromRenderSystemCapabilities().

The code in GL3PlusRenderSystem::_createRenderWindow() looks like this:

RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp

Obviously, you can't simply swap the order of the two method calls. However, commenting out the call to GpuProgramManager::getSingleton() inside of createRenderSystemCapabilities() solves the immediate symptom of a failed assertion/crash...

I have not looked at the two offending methods in great detail. It doesn't seem like it would take a great deal of work to sort this out, but I don't really know!

Environment

Debug build, OpenGL3+ rendersystem selected

Assignee

Murat Sari

Reporter

AJ Gardner

Labels

None

Time tracking

3h

Components

Fix versions

Affects versions

Priority

Major
Configure