> ## 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

> デバッグ インターフェイスを取得します。

デバッグ インターフェイスを取得します。

新しいインターフェイスに直接アクセスするには、特にダウンレベルで、[D3D12GetInterface](/reference/graphics/d3d12/functions/d3d12getinterface_public) を使用します。

## 構文

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

### パラメーター

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

デバッグ インターフェイスのグローバル一意識別子 (**GUID**)。
デバッグ インターフェイスの **REFIID** または **GUID** は、\_\_uuidof() マクロを使用して取得できます。
たとえば、\_\_uuidof([ID3D12Debug](https://learn.microsoft.com/en-us/windows/desktop/api/d3d12sdklayers/nn-d3d12sdklayers-id3d12debug)) は、デバッグ インターフェイスの **GUID** を取得します。

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

void へのポインターのポインターとしてのデバッグ インターフェイス。
[ID3D12Debug](https://learn.microsoft.com/en-us/windows/desktop/api/d3d12sdklayers/nn-d3d12sdklayers-id3d12debug) および
[ID3D12DebugDevice](https://learn.microsoft.com/en-us/windows/desktop/api/d3d12sdklayers/nn-d3d12sdklayers-id3d12debugdevice) を参照してください。

### 戻り値

型: HRESULT

このメソッドは、[Direct3D 12 リターン コード](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues) のいずれかを返します。

## 解説

関数シグネチャ PFN\_D3D12\_GET\_DEBUG\_INTERFACE は typedef として提供されるため、静的リンクではなく、動的リンク手法 ([GetProcAddress](https://learn.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-getprocaddress)) を使用できます。

#### 例

D3D12 デバッグ レイヤーを有効にします。

```cpp theme={null}
// Enable the D3D12 debug layer.
{

ComPtr<ID3D12Debug> debugController;
if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debugController))))
{
debugController->EnableDebugLayer();
}
}

```

[D3D12 リファレンスのサンプル コード](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/notes-on-example-code) を参照してください。

<div class="code" />

## 要件

**ヘッダー:** d3d12\_xs.h または d3d12\_x.h\
**ライブラリ:** d3d12\_xs.lib または d3d12\_x.lib\
**サポートされるプラットフォーム**: XBOX Series 本体および XBOX One ファミリ

## 関連項目

[コア関数](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-functions)


## Related topics

- [ID3D12DeviceRemovedExtendedDataSettings](/ja-jp/reference/graphics/d3d12/interfaces/id3d12deviceremovedextendeddatasettings/id3d12deviceremovedextendeddatasettings_public.md)
- [D3D12EnableExperimentalFeatures](/ja-jp/reference/graphics/d3d12/functions/d3d12enableexperimentalfeatures_public.md)
- [D3D12GetInterface (XBOX Series 本体)](/ja-jp/reference/graphics/d3d12/functions/d3d12getinterface_public.md)
- [SetName](/ja-jp/reference/graphics/d3d12/interfaces/id3d12object/methods/id3d12object_setname_public.md)
- [DSTORAGE_DEBUG](/ja-jp/reference/system/dstorage/enums/dstorage_debug.md)
