Closed corentinjaffre closed 1 year ago
I fixed the issue by adding this to MyGUI:
mDefaultShader->vertexProgram->load();
mDefaultShader->fragmentProgram->load();
Where did you add that?
Can you make a pull request?
Actually I didn't make a PR, because I'm not sure of what is causing this issue. Anyway, I change in MyGUI_OgreRenderManager.cpp the void OgreRenderManager::registerShader method and added the 2 lines in
if (_shaderName == "Default")
{
mDefaultShader = mRegisteredShaders[_shaderName];
// Set the default shader
mDefaultShader->vertexProgram->load();
mDefaultShader->fragmentProgram->load();
mPass->setVertexProgram(mDefaultShader->vertexProgram->getName());
mPass->setFragmentProgram(mDefaultShader->fragmentProgram->getName());
}
In my game editor when I load a new game/level I destroy and recreate MyGUI. It has been working perfectly for years until Ogre 1.13. Now, when I recreate a second-time MyGUI, the first call to RenderWindow->update() throw an exception: Null program bound with D3D9RenderSystem::bindGpuProgram. The exception occurs with MyGUI shader MyGUI_Ogre_VP.hlsl. The resource is marked as LOADSTATE_PREPARED the second time I restart MyGUI, could it be the issue?
My trace: