-
Notifications
You must be signed in to change notification settings - Fork 544
Debugging D3D
Dzmitry Malyshau edited this page Oct 29, 2020
·
3 revisions
Assorted tips for debugging D3D problems.
The refcount of a COM object is 9 32 bit words behind the pointer's destination and is 4 bytes. As such, subtract 36 from the pointer's address to get a pointer to that object's refcount. This allows you to use data breakpoints to see all changes to the object's refcount, useful for detecting leaks and other such things.
We request a debug kind of device when running in debug builds. The output goes to the "Windows Debug Output". It can be intercepted with DebugView, or you'll see it in the output window if you run the app directly from Visual Studio. To do that, you'll need to "Open Project" and select the executable (instead of a project file).