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

# D3D12EnableExperimentalFeatures

> 啟用實驗性功能清單。

啟用實驗性功能清單。

## 語法

```cpp theme={null}
HRESULT D3D12EnableExperimentalFeatures(
    UINT NumFeatures,
    const IID  pIIDs,
    void  pConfigurationStructs,
    UINT  pConfigurationStructSizes
)
```

### 參數

*NumFeatures*\
類型：UINT

要啟用的實驗性功能數目。

*pIIDs \[in]*\
類型：const IID \*

[SAL](https://learn.microsoft.com/en-us/visualstudio/code-quality/annotating-function-parameters-and-return-values?view=vs-2015\&preserve-view=true)：<code>\_\_in\_ecount(NumFeatures)</code>

指向 ID 陣列的指標，這些 ID 指定要啟用哪些可用的實驗性功能。

*pConfigurationStructs \[in]*\
類型：void \*

[SAL](https://learn.microsoft.com/en-us/visualstudio/code-quality/annotating-function-parameters-and-return-values?view=vs-2015\&preserve-view=true)：<code>\_\_in\_ecount(NumFeatures)</code>

包含某些實驗性功能在啟用時可能需要之其他設定詳細資料的結構。

*pConfigurationStructSizes \[in]*\
類型：UINT \*

[SAL](https://learn.microsoft.com/en-us/visualstudio/code-quality/annotating-function-parameters-and-return-values?view=vs-2015\&preserve-view=true)：<code>\_\_in\_ecount(NumFeatures)</code>

在 pConfigurationStructs 參數中傳入之任何設定結構的大小。

### 傳回值

類型：HRESULT

此方法會傳回 HRESULT 成功或錯誤碼；如果指定了無法辨識的功能或未啟用開發人員模式，則可能包括 E\_NOINTERFACE；如果功能的設定不正確、指定的實驗性功能不相容或發生其他錯誤，則可能包括 E\_INVALIDARG。

## 備註

請在建立裝置之前呼叫此函式。

由於實驗性功能集會隨著時間變更，而且這些功能可能不穩定，因此僅供開發和實驗使用。系統透過要求必須先啟用開發人員模式才能啟用任何實驗性功能，來強制執行這項規定。

目前支援的實驗性功能集可在 D3D12.h 標頭中 D3D12EnableExperimentalFeatures 函式的定義附近找到；由於實驗性功能很少提供，因此通常會發現目前不支援任何實驗性功能。

某些實驗性功能可能會使用 IID 作為 GUID 來識別。對於這些功能，您可以使用 D3D12GetDebugInterface 並傳遞 IID 作為參數，以擷取用來操作該功能的介面。

如果再次呼叫此函式並傳入不同的要啟用功能清單，所有目前的 D3D12 裝置都會設定為 DEVICE\_REMOVED 狀態。

#### 範例

此範例示範實驗性功能定義的樣貌。

```cpp theme={null}
// --------------------------------------------------------------------------------------------------------------------------------
// Experimental Feature: D3D12ExperimentalShaderModels
//
// Use with D3D12EnableExperimentalFeatures to enable experimental shader model support,
// meaning shader models that haven't been finalized for use in retail.
//
// Enabling D3D12ExperimentalShaderModels needs no configuration struct, pass NULL in the pConfigurationStructs array.
//
// --------------------------------------------------------------------------------------------------------------------------------
static const UUID D3D12ExperimentalShaderModels = { /* 76f5573e-f13a-40f5-b297-81ce9e18933f */
0x76f5573e,
0xf13a,
0x40f5,
{ 0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f }
};

```

## 需求

**標頭：** 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

- [D3D12_COLOR_WRITE_ENABLE](/zh-TW/reference/graphics/d3d12/enums/d3d12_color_write_enable_public.md)
- [D3D12_DRED_ENABLEMENT](/zh-TW/reference/graphics/d3d12/enums/d3d12_dred_enablement_public.md)
- [D3D12_BLEND_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_blend_desc_public.md)
- [D3D12_RENDER_TARGET_BLEND_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_render_target_blend_desc_public.md)
- [D3D12_FEATURE](/zh-TW/reference/graphics/d3d12/enums/d3d12_feature_public.md)
