ID3D12Debug::EnableDebugLayer method

Enables the debug layer.

Syntax

void EnableDebugLayer(

);

Parameters

This method has no parameters.

Return Value

This method does not return a value.

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

   
Target Platform Windows
Header d3d12sdklayers.h

See Also

ID3D12Debug