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

# CreateMetaCommand (XBOX Series 主机)

> 创建指定元命令的实例。

创建指定元命令的实例。

## 语法

```cpp theme={null}
HRESULT CreateMetaCommand(
    const GUID & CommandId,
    UINT NodeMask,
    const void  pCreationParametersData,
    SIZE_T CreationParametersDataSizeInBytes,
    const IID & riid,
    void  ppMetaCommand
)
```

### 参数

*CommandId \[in]*\
类型：const GUID &

对您希望实例化的元命令的全局唯一标识符 (GUID) 的引用。

*NodeMask \[in]*\
类型：UINT

对于单适配器操作，请将其设置为零。如果存在多个适配器节点，则设置一个位以标识元命令适用的节点（设备的其中一个物理适配器）。掩码中的每个位对应一个节点。只能设置一个位。请参阅[多适配器系统](https://learn.microsoft.com/en-us/windows/win32/direct3d12/multi-engine)。

*pCreationParametersData \[in, optional]*\
类型：const void \*

一个可选指针，指向包含用于创建元命令的参数值的常量结构。

*CreationParametersDataSizeInBytes \[in]*\
类型：SIZE\_T

一个 [SIZE\_T](https://learn.microsoft.com/en-us/windows/win32/WinProg/windows-data-types)，包含 <i>pCreationParametersData</i> 所指向结构的大小（如果已设置），否则为 0。

*riid*\
类型：const IID &

对希望在 <i>ppMetaCommand</i> 中返回的接口的全局唯一标识符 (GUID) 的引用。这应该是 [ID3D12MetaCommand](/reference/graphics/d3d12/interfaces/id3d12metacommand/id3d12metacommand_public) 的 GUID。

*ppMetaCommand \[out]*\
类型：void \*\*

指向内存块的指针，该内存块接收指向元命令的指针。这是指向表示所创建元命令的 [ID3D12MetaCommand](/reference/graphics/d3d12/interfaces/id3d12metacommand/id3d12metacommand_public) 的指针的地址。

### 返回值

类型：HRESULT

如果此方法成功，则返回 **S\_OK**。否则，返回 **HRESULT** 错误代码。

<table>
  <tr>
    <th>返回值</th>
    <th>描述</th>
  </tr>

  <tr>
    <td width="40%">
      <dl>
        <dt>DXGI\_ERROR\_UNSUPPORTED</dt>
      </dl>
    </td>

    <td width="60%">
      当前硬件不支持所请求的算法
    </td>
  </tr>
</table>

## 要求

**头文件：** d3d12\_xs.h\
**库：** d3d12\_xs.lib\
**支持的平台**：XBOX Series 主机

## 另请参阅

[ID3D12Device5](/reference/graphics/d3d12/interfaces/id3d12device5/id3d12device5_public)


## Related topics

- [InitializeMetaCommand (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_initializemetacommand_public.md)
- [EnumerateMetaCommands (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device5/methods/id3d12device5_enumeratemetacommands_public.md)
- [EnumerateMetaCommandParameters (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device5/methods/id3d12device5_enumeratemetacommandparameters_public.md)
- [CreateCommandQueue1 (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_createcommandqueue1_public.md)
- [CreateCommandList1 (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createcommandlist1_public.md)
