> ## 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 数组的指针，该数组指定要启用的可用实验性功能。

*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 来标识。对于这些功能，您可以将 IID 作为参数传递给 D3D12GetDebugInterface 来获取用于操作该功能的接口。

如果使用不同的功能列表再次调用此函数，则所有当前的 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-CN/reference/graphics/d3d12/enums/d3d12_color_write_enable_public.md)
- [D3D12_DRED_ENABLEMENT](/zh-CN/reference/graphics/d3d12/enums/d3d12_dred_enablement_public.md)
- [D3D12_BLEND_DESC](/zh-CN/reference/graphics/d3d12/structs/d3d12_blend_desc_public.md)
- [D3D12_FEATURE](/zh-CN/reference/graphics/d3d12/enums/d3d12_feature_public.md)
- [D3D12_RENDER_TARGET_BLEND_DESC](/zh-CN/reference/graphics/d3d12/structs/d3d12_render_target_blend_desc_public.md)
