D3D12GetDebugInterface function (d3d12.h)

Gets a debug interface.

Use D3D12GetInterface to directly access newer interfaces, especially downlevel.

Syntax

HRESULT D3D12GetDebugInterface(
  [in]            REFIID riid,
  [out, optional] void   **ppvDebug
);

Parameters

[in] riid

Type: REFIID

The globally unique identifier (GUID) for the debug interface. The REFIID, or GUID, of the debug interface can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D12Debug) will get the GUID of the debug interface.

[out, optional] ppvDebug

Type: void**

The debug interface, as a pointer to pointer to void. See ID3D12Debug and ID3D12DebugDevice.

Return value

Type: HRESULT

This method returns one of the Direct3D 12 Return Codes.

Remarks

The function signature PFN_D3D12_GET_DEBUG_INTERFACE is provided as a typedef, so that you can use dynamic linking techniques (GetProcAddress) instead of statically linking.

Examples

Enable the D3D12 debug layer.

// Enable the D3D12 debug layer.
{
    
    ComPtr<ID3D12Debug> debugController;
    if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debugController))))
    {
        debugController->EnableDebugLayer();
    }
}

Refer to the Example Code in the D3D12 Reference.

Requirements

Requirement Value
Target Platform Windows
Header d3d12.h
Library D3D12.lib
DLL D3D12.dll

See also

Core Functions