[SOLVED] Ogre 1.12 to 1.13: Null program bound with D3D9RenderSystem::bindGpuProgram

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

[SOLVED] Ogre 1.12 to 1.13: Null program bound with D3D9RenderSystem::bindGpuProgram

Post by suny »

Ogre Version: 1.13
Operating System: windows
Render System: dx9

Hi,
Still trying to make my game in working order from 1.12 to 1.13: I think almost everything is alright now, but I have an exception each time I reload a level:
Null program bound with D3D9RenderSystem::bindGpuProgram

When I reload a level in the editor, I shut down MyGUI, then recreate it. When I restart the level, the first call to RenderWindow->update() throw an exception:

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?
S.

My stack:

Code: Select all

KernelBase.dll!7637c5af()	Unknown
 	KernelBase.dll![Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]	Unknown
 	[External Code]	
 	RenderSystem_Direct3D9_d.dll!Ogre::ExceptionFactory::_throwException(Ogre::Exception::ExceptionCodes code=ERR_RENDERINGAPI_ERROR, int number=3, const std::string & desc={...}, const std::string & src={...}, const char * file=0x04741200, long line=3285) Line 266	C++
 	RenderSystem_Direct3D9_d.dll!Ogre::ExceptionFactory::throwException(Ogre::Exception::ExceptionCodes code=ERR_RENDERINGAPI_ERROR, const std::string & desc={...}, const std::string & src={...}, const char * file=0x04741200, long line=3285) Line 282	C++
 	RenderSystem_Direct3D9_d.dll!Ogre::D3D9RenderSystem::bindGpuProgram(Ogre::GpuProgram * prg=0x00000000) Line 3283	C++
 	OgreMain_d.dll!Ogre::SceneManager::bindGpuProgram(Ogre::GpuProgram * prog=0x00000000) Line 3821	C++
 	OgreMain_d.dll!Ogre::SceneManager::_setPass(const Ogre::Pass * pass=0x0543cf90, bool evenIfSuppressed=false, bool shadowDerivation=true) Line 868	C++
 	ShmupCreator.exe!MyGUI::OgreRenderManager::begin() Line 317	C++
 	ShmupCreator.exe!MyGUI::OgreRenderManager::renderQueueStarted(unsigned char queueGroupId='d', const std::string & invocation={...}, bool & skipThisInvocation=false) Line 205	C++
 	OgreMain_d.dll!Ogre::SceneManager::fireRenderQueueStarted(unsigned char id='d', const std::string & invocation={...}) Line 2475	C++
 	OgreMain_d.dll!Ogre::SceneManager::renderVisibleObjectsDefaultSequence() Line 1547	C++
 	OgreMain_d.dll!Ogre::SceneManager::_renderVisibleObjects() Line 1522	C++
 	OgreMain_d.dll!Ogre::SceneManager::_renderScene(Ogre::Camera * camera=0x08864138, Ogre::Viewport * vp=0x0cc3a370, bool includeOverlays=true) Line 1325	C++
 	OgreMain_d.dll!Ogre::Camera::_renderScene(Ogre::Viewport * vp=0x0cc3a370) Line 496	C++
 	OgreMain_d.dll!Ogre::Viewport::update() Line 219	C++
 	OgreMain_d.dll!Ogre::RenderTarget::_updateViewport(Ogre::Viewport * viewport=0x0cc3a370, bool updateStatistics=true) Line 199	C++
 	RenderSystem_Direct3D9_d.dll!Ogre::D3D9RenderWindow::_updateViewport(Ogre::Viewport * viewport=0x0cc3a370, bool updateStatistics=true) Line 841	C++
 	OgreMain_d.dll!Ogre::RenderTarget::_updateAutoUpdatedViewports(bool updateStatistics=true) Line 176	C++
 	OgreMain_d.dll!Ogre::RenderTarget::updateImpl() Line 153	C++
 	OgreMain_d.dll!Ogre::RenderTarget::update(bool swap=false) Line 555	C++
>	ShmupCreator.exe!playState::startEditor() Line 4958	C++
 	ShmupCreator.exe!playState::init(Ogre::RenderWindow * mrenderWindow=0x00731550, Ogre::OverlaySystem * OverlaySystem=0x0069d7a8, Game * mgam=0x01745818) Line 486	C++
 	ShmupCreator.exe!GameManager::changeState(GameState * state=0x01746b98) Line 69	C++
 	ShmupCreator.exe!GameState::changeState(GameState * state=0x01746b98) Line 40	C++
 	ShmupCreator.exe!playState::Update(const double deltatime=0.033333000000000002) Line 1277	C++
 	ShmupCreator.exe!GameManager::update(const double deltatime=0.033333000000000002) Line 103	C++
 	ShmupCreator.exe!RealMain(HINSTANCE__ * hInstance=0x00ee0000, char * lpCmdLine=0x0064559f, int nCmdShow=10) Line 904	C++
 	ShmupCreator.exe!WinMain(HINSTANCE__ * hInstance=0x00ee0000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x0064559f, int nCmdShow=10) Line 1046	C++
 	[External Code]	
Last edited by suny on Wed Sep 22, 2021 9:21 am, edited 1 time in total.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Ogre 1.12 to 1.13: Null program bound with D3D9RenderSystem::bindGpuProgram

Post by paroj »

The resource is marked as LOADSTATE_PREPARED the second time I restart MyGUI, could it be the issue?
yes, it must be in loaded state for the bindingDelegate to be created. This also explains why you get a null program there.
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 450
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 156

Re: Ogre 1.12 to 1.13: Null program bound with D3D9RenderSystem::bindGpuProgram

Post by sercero »

Hello,

Why don't you just destroy the Widgets used in the level instead of shutting down MyGUI each time?

I use this: mGUI->destroyAllChildWidget(); (where mGUI is a pointer to the MyGUI main Manager: MyGUI::Gui)

Another possibility is unloading the layouts used.

In fact there is a question in the MyGUI subforums about this subject and Altrens response is along those lines.
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: [SOLVED] Ogre 1.12 to 1.13: Null program bound with D3D9RenderSystem::bindGpuProgram

Post by suny »

Thanks for your answers!

I modified MyGUI to force the shader loading, and it fixed the issue

Code: Select all

mDefaultShader->vertexProgram->load();
mDefaultShader->fragmentProgram->load();
S.
Post Reply