Debugging Directx10

Started by
8 comments, last by XVincentX 15 years, 10 months ago
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.
Advertisement
Unfortunately the current version of the debug layer doesn’t report resource leaks. You can use PIX for this job.
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.
I suggest writing a smart pointer class for DX interfaces, which calls AddRef and Release whenever needed. That should solve your memory leak problem.
Every time you implement a singleton, God kills a kitten. Please, think of the kittens!
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).
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>.
Sirob Yes.» - status: Work-O-Rama.
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
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.
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.
Yes.The best function is the Vertex-Geometry-Pixel Shader pre and post view

This topic is closed to new replies.

Advertisement