Jump to content
  • Advertisement
Sign in to follow this  
Shawn19841006

Weird device lost recovery bug, need help

This topic is 3179 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!