Sign in to follow this  

Debugging Directx10

This topic is 3457 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

I have turn on the directx10 debugging by setting the Debug Layer in the Directx Control Panel to be 'Force On' Right now the output window in VC++ does shows me the INFO category messages e.g D3D10: INFO: ID3D10Device::PSSetSamplers: A currently bound PixelShader Sampler is being deleted; so naturally, will no longer be bound. [ STATE_SETTING INFO #45: PSSETSAMPLERS_UNBINDDELETINGOBJECT ] However, how do I enable the debugger to report if I am forgetting to release any Directx interface? I currently intentionally did not release a ID3D10Texture2D interface, however the debugger did not complain any errors.

Share this post


Link to post
Share on other sites
Quote:
Original post by Demirug
Unfortunately the current version of the debug layer doesn’t report resource leaks. You can use PIX for this job.


It's owful this thing.

Share this post


Link to post
Share on other sites
Quote:
Original post by XVincentX
Quote:
Original post by Demirug
Unfortunately the current version of the debug layer doesn’t report resource leaks. You can use PIX for this job.


It's owful this thing.

PIX is awful?
It's damn useful, and real easy, and will show EXACTLY what he wants:

Create a new experiment, set your program path, select "A replayable Direct3D call steam, saved to file", and start the experiment. Do whatever you need to in-game (load a level, shoot stuff, whatever), then quit.
Then open that stream file.
On the bottom left in the Events, go to the last frame (not sure if you need to actually select the last frame), then in your Objects pane, you should see all the DX objects that were created, in the Destruction column, if it says "Never", it means it was never released.
Take note though; your Device may also say Never, as anything that was created by it, MUST also be destroyed in order for it to be destroyed. So in your case of not releasing ID3D10Texture2D, assuming nothing else, you'll have D3D10Device as Never, and D3D10 Buffer as Never (or whatever it is).

Share this post


Link to post
Share on other sites
Quote:
Original post by darkelf2k5
I suggest writing a smart pointer class for DX interfaces, which calls AddRef and Release whenever needed. That should solve your memory leak problem.

Or you could use CComPtr<T>.

Share this post


Link to post
Share on other sites
Thanks for the replies. I am currently using _com_ptr_t and not CComPtr as I don't have atl on my computer. My visual studio is the express edition.

Just wanted to double check that all resources are being released correctly :D

Share this post


Link to post
Share on other sites
Quote:
Original post by XVincentX
No no no, i was not saying that PIX it's owful.
I was lamenting about the debug dlls, that now shows very few informations.

Ah, my mistake. But yea, the debug dlls are near useless for real detail. PIX is the best tool you can learn to debug DX.

Share this post


Link to post
Share on other sites

This topic is 3457 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