D3D12 debug layers. How to get ID3D12DebugDevice?

Started by
2 comments, last by Volgogradetzzz 8 years, 6 months ago

Greetings.

1. Documentation for ID3D12Debug says:

This interface is obtained by querying it from the ID3D12Device using IUnknown::QueryInterface.

But all the examples are using


D3D12GetDebugInterface()

And after all how can I obtain it from a device if there're no flags anymore pointing that the device is debug?

2. How to get ID3D12DebugDevice, ID3D12DebugCommandList, ID3D12DebugCommandQueue?

Advertisement

I haven't used D3D12 yet, but i guess it will be the same as in D3D11. Meaning you call IUnknown::QueryInterface on your device, command list and command queue.

You need to initially use D3D12GetDebugInterface() to get ID3D12Debug, and then call EnableDebugLayer(). In fact you need to do this before you ever create a device, otherwise things will blow up in spectacular ways. Once you've enabled the debug layer and created your device, you can obtain ID3D12DebugDevice\ID3D12DebugCommandList\ID3D12DebugCommandQueue by using QueryInterface on ID3D12Device\ID3D12CommandList\ID3D12CommandQueue. You can also use QueryInterface to get ID3D12Debug from your ID3D12Device, but only if you first called D3D12GetDebugInterface and called EnableDebugLayer.

Thank you guys. That works ).

This topic is closed to new replies.

Advertisement