ID3D12Debug::EnableDebugLayer method (d3d12sdklayers.h)

Enables the debug layer.

Syntax

void EnableDebugLayer();

Return value

None

Remarks

To enable the debug layers using this API, it must be called before the D3D12 device is created. Calling this API after creating the D3D12 device will cause the D3D12 runtime to remove the device.

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 d3d12sdklayers.h

See also

ID3D12Debug