> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# D3D12GetDebugInterface

> Gets a debug interface.

Gets a debug interface.

Use [D3D12GetInterface](/reference/graphics/d3d12/functions/d3d12getinterface_public) to directly access newer interfaces, especially downlevel.

## Syntax

```cpp theme={null}
HRESULT D3D12GetDebugInterface(
    const IID & riid,
    void  ppvDebug
)
```

### Parameters

*riid \[in]*\
Type: const IID &

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](https://learn.microsoft.com/en-us/windows/desktop/api/d3d12sdklayers/nn-d3d12sdklayers-id3d12debug)) will get the **GUID** of the debug interface.

*ppvDebug \[out, optional]*\
Type: void \*\*

The debug interface, as a pointer to pointer to void.
See
[ID3D12Debug](https://learn.microsoft.com/en-us/windows/desktop/api/d3d12sdklayers/nn-d3d12sdklayers-id3d12debug) and
[ID3D12DebugDevice](https://learn.microsoft.com/en-us/windows/desktop/api/d3d12sdklayers/nn-d3d12sdklayers-id3d12debugdevice).

### Return value

Type: HRESULT

This method returns one of the [Direct3D 12 Return Codes](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues).

## Remarks

The function signature PFN\_D3D12\_GET\_DEBUG\_INTERFACE is provided as a typedef, so that you can use dynamic linking techniques ([GetProcAddress](https://learn.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-getprocaddress)) instead of statically linking.

#### Examples

Enable the D3D12 debug layer.

```cpp theme={null}
// 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](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/notes-on-example-code).

<div class="code" />

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[Core Functions](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-functions)


## Related topics

- [ID3D12DeviceRemovedExtendedDataSettings](/reference/graphics/d3d12/interfaces/id3d12deviceremovedextendeddatasettings/id3d12deviceremovedextendeddatasettings_public.md)
- [D3D12EnableExperimentalFeatures](/reference/graphics/d3d12/functions/d3d12enableexperimentalfeatures_public.md)
- [D3D12GetInterface (XBOX Series consoles)](/reference/graphics/d3d12/functions/d3d12getinterface_public.md)
- [D3D12_AUTO_BREADCRUMB_NODE](/reference/graphics/d3d12/structs/d3d12_auto_breadcrumb_node_public.md)
- [SetName](/reference/graphics/d3d12/interfaces/id3d12object/methods/id3d12object_setname_public.md)
