0.7.1 ogrerenderer dx9 crash when lost device

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

heeroz
Just popping in
Just popping in
Posts: 7
Joined: Wed May 26, 2010 06:33

0.7.1 ogrerenderer dx9 crash when lost device

Postby heeroz » Wed May 26, 2010 07:28

sdk: Ogre 1.7.1, cegui 0.7.1

Run Sample_Demox_d.exe, select ogrerenderer, choose dx9 render, full-screen no. when sample started, then move window to another display, you'll got:

OGRE EXCEPTION(7:InternalErrorException): Cannot begin frame - no viewport selected. in D3D9RenderSystem::_beginFrame at ..\..\..\RenderSystems\Direct3D9\src\OgreD3D9RenderSystem.cpp (line 2818)

look like because ogre main render in vewport update event, so it's OK, but ceguiogrerenderer render in frameRenderingQueued.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: 0.7.1 ogrerenderer dx9 crash when lost device

Postby CrazyEddie » Wed May 26, 2010 08:35

Thanks for the report, though we do already have a ticket open for this issue: http://www.cegui.org.uk/mantis/view.php?id=367 Hopefully it will get fixed in a couple of weeks or so :)

CE.

heeroz
Just popping in
Just popping in
Posts: 7
Joined: Wed May 26, 2010 06:33

Re: 0.7.1 ogrerenderer dx9 crash when lost device

Postby heeroz » Thu Sep 02, 2010 13:08

Thank you, but there is another lost device bug

crash when lost device:

OGRE EXCEPTION(3:RenderingAPIException): Failed to DrawPrimitive : Invalid call in D3D9Re
nderSystem::_render at ..\..\..\RenderSystems\Direct3D9\src\OgreD3D9RenderSystem
.cpp (line 3115)

Direct3D9: (ERROR) :Need to call BeginScene before rendering.

Direct3D9: (ERROR) :DrawPrimitive failed.

D3D9 Helper: IDirect3DDevice9::DrawPrimitive failed: D3DERR_INVALIDCALL

Analyse:

Code: Select all

void System::renderGUI(void)
{
    d_renderer->beginRendering();
...
    d_renderer->getDefaultRenderingRoot().draw();
...
}


beginRendering will call getActiveD3D9Device()->BeginScene(), but next line d_renderer->getDefaultRenderingRoot().draw() will change ActiveD3D9Device when lost device.

here is code where ActiveD3D9Device changed:

d_renderer->getDefaultRenderingRoot().draw() call OgreRenderTarget::activate():

Code: Select all

void OgreRenderTarget::activate()
{
...
    d_renderSystem._setViewport(d_viewport);
...
}


and _setViewport will check device, if lost, update D3D9DeviceManager::mActiveRenderWindowDevice.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: 0.7.1 ogrerenderer dx9 crash when lost device

Postby CrazyEddie » Sun Sep 05, 2010 08:30

First I have to say that the previous issue is not fixed yet either - as evidenced by the fact the mantis ticket is not marked as resolved ;)

As for D3D specific information when using Ogre, within CEGUI I believe we have no access to any of that information. While these issues stem from our use of really low level Ogre APIs, I don't think there is a means within the Ogre API for us to know whether a D3D device is lost (or not), so how should we proceed in such cases when we do not have that information?

It may be that the Ogre renderer for CEGUI will be rewritten to use the regular, higher-level, APIs in Ogre. If - or when - that happens, all of these issues should go away. :?

CE


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 14 guests