Sign in to follow this  

Weird device lost recovery bug, need help

This topic is 2843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello world. I'm dealing with device lost code but I got a weird bug. I do release all my resources created with default pool, and then I call device->reset. And it did returned S_OK. But an access violation exception occured later when I call device->DrawIndexedPrimitive. I have no clue where that address comes from. The weird thing is when I use d3d debug runtime, when I call device->reset, it gives me this message : Direct3D9: (ERROR) :************************************************************ Direct3D9: (ERROR) :ASSERTION FAILED! File e:\dxsdk\wggt_apr07\private\multimedia\directx\dxg\d3d9\fw\mipsurf.hpp Line 74: m_cRefDebug == 0 Direct3D9: (ERROR) :************************************************************ But then no exception occurred and the game continues to run without problem. Any idea will be thankful.

Share this post


Link to post
Share on other sites
What happens if you explicitly call SetTexture(0, NULL) (and once for every texture stage you have)? Do you still get that debug error on the Reset() call?

Looking at the source code, it seems to be that the assert triggers if the reference count for a mipmap level of a texture is nonzero when the texture is destroyed, which implies you have a reference to a mip level somewhere (Which may be your backbuffer, not necessarily a texture) which you haven't Release()d.

Do you ever call GetSurfaceLevel(), GetBackBuffer(),m or any other Get*() functions which return a surface? And if so, are you absolutely sure you Release() each of them after you've finished with them?

Aside from that, you could try commenting out chunks of your code until the problem goes away; whatever is left must then be causing the bug.

Share this post


Link to post
Share on other sites

This topic is 2843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this