[SOLVED] D3D9 Device 0x[02B3FB60] entered lost state after Ctrl+alt+del

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] D3D9 Device 0x[02B3FB60] entered lost state after Ctrl+alt+del

Post by suny »

Ogre Version: 1.12.13
Operating System: windows
Render System: dx9c

Hi,
I have a crash 100% reproducible each time I ctrl+alt+del when my app is running.
I'm using allowDirectx9Ex.

Is there a way to prevent my app from crashing every time?
S.

Code: Select all

D3D9 Device 0x[02B3FB60] entered lost state
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: c84/scene/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: Released D3D9 texture: c84/scene/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: 188123800_Canvas
22:18:54: Released D3D9 texture: 188123800_Canvas
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: 191451624_Canvas
22:18:54: Released D3D9 texture: 191451624_Canvas
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: 191458632_Canvas
22:18:54: Released D3D9 texture: 191458632_Canvas
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: 191457464_Canvas
22:18:54: Released D3D9 texture: 191457464_Canvas
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: 191460384_Canvas
22:18:54: Released D3D9 texture: 191460384_Canvas
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: 199071264_Canvas
22:18:54: Released D3D9 texture: 199071264_Canvas
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: Ogre/ShadowTexture0
22:18:54: Released D3D9 texture: Ogre/ShadowTexture0
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: c85/scene/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: Released D3D9 texture: c85/scene/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: c88/scene/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: Released D3D9 texture: c88/scene/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: c87/outlinesHoover/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: Released D3D9 texture: c87/outlinesHoover/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: D3D9 device: 0x[02B3FB60] lost. Releasing D3D9 texture: c86/outlinesSelected/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: Released D3D9 texture: c86/outlinesSelected/SHMUP_CREATOR_by_bulo_studio_-_v0.9.37.4_-_September_2021_-
22:18:54: D3D9 Device 0x[02B3FB60] entered lost state
22:18:54: Ogre::ItemIdentityException::ItemIdentityException: Cannot find buffer binding for index 0 in VertexBufferBinding::unsetBinding at C:\OgreSDK\Ogre3D\ogre\OgreMain\src\OgreHardwareVertexBuffer.cpp (line 777)
Last edited by suny on Sat Sep 11, 2021 2:08 pm, edited 1 time in total.
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 449
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 156

Re: D3D9 Device 0x[02B3FB60] entered lost state after Ctrl+alt+del

Post by sercero »

I have the same problem, do you know if this worked in previous OGRE versions?

It is something I have never tested before...
User avatar
EricB
Bronze Sponsor
Bronze Sponsor
Posts: 360
Joined: Fri Apr 09, 2010 5:28 am
Location: Florida
x 213
Contact:

Re: D3D9 Device 0x[02B3FB60] entered lost state after Ctrl+alt+del

Post by EricB »

I've had so many issues over the years with various people's computers when a DX9 window loses focus. Alt-tab back and forth millions of times is normally the culprit... This looks similar to that.

I am assuming you're using a modern windows, when you hit alt-control-delete, it bounces to a splash screen rather than just pulls up a task window.

From my understanding, when a DX9 loses focus, it purges all the information out of the vram. If at anytime you try to access that information while it's not in vram, you crash. Likewise, when the window regains focus, the vram is supposed to repopulated, but occasionally this doesn't work. You try to access that information, and then boom. Crash again.

Check to see if you stop rendering if your window loses focus. If you don't, try that. If you do, make sure all logic pauses when you lose window focus. If it still crashes after that, try manually unloading and reloading the scenes/ui anytime the window loses focus.

All else fails, OpenGL tends to not have this problem. At least with my game.
Image
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: D3D9 Device 0x[02B3FB60] entered lost state after Ctrl+alt+del

Post by suny »

I have the same problem, do you know if this worked in previous OGRE versions?
I'm not sure. There is plenty of message in this forum about that kind of crash, so I guess it's something that has been there for years.
Check to see if you stop rendering if your window loses focus. If you don't, try that. If you do, make sure all logic pauses when you lose window focus.
I think I do:

Code: Select all

const int window_shown = (flags & SDL_WINDOW_INPUT_FOCUS) ? true : false;
if (window_shown)
{
    (other stuffs)
     gameMgr->update(double(deltaTime) * 0.000001);
     accumulator += double(deltaTime) * 0.000001;
     gameMgr->sdlEvents();
}
else
{
	Sleep(20);
	gameMgr->sdlEvents();
	gameMgr->currentTime = Root::getSingletonPtr()->getTimer()->getMilliseconds();
}
If it still crashes after that, try manually unloading and reloading the scenes/ui anytime the window loses focus.
How can I do that?

Thanks everyone,
S.
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: D3D9 Device 0x[02B3FB60] entered lost state after Ctrl+alt+del

Post by suny »

Ok, I fixed the issue, but I don't understand what was happening...

I pinpoint the issue to an overlay:
I didn't crashed anymore if I commented in my code:

Code: Select all

Ogre::OverlayManager::getSingleton().getByName("GameOverlay")->show();
The overlay was using incorrectly BorderPanel instead of Panel in the overlay script overlay_element.
Changing this stoped my app to crash with each ctrl+alt+suppr.
S.
Post Reply