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

# D3D12_INPUT_ELEMENT_DESC

> 描述图形管线输入汇编器阶段的单个元素。

描述图形管线输入汇编器阶段的单个元素。

## 语法

```cpp theme={null}
typedef struct D3D12_INPUT_ELEMENT_DESC
{
    LPCSTR SemanticName;
    UINT SemanticIndex;
    DXGI_FORMAT Format;
    UINT InputSlot;
    UINT AlignedByteOffset;
    D3D12_INPUT_CLASSIFICATION InputSlotClass;
    UINT InstanceDataStepRate;
} D3D12_INPUT_ELEMENT_DESC
```

### 成员

*SemanticName*\
类型：LPCSTR

在着色器输入签名中与此元素关联的 HLSL 语义。有关详细信息，请参阅 [HLSL Semantics](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-semantics)。

*SemanticIndex*\
类型：UINT

元素的语义索引。语义索引使用整数索引号修改语义。仅当有多个元素具有相同语义时才需要语义索引。例如，一个 4x4 矩阵将有四个分量，每个分量都具有语义名称 **matrix**，然而这四个分量将具有不同的语义索引（0、1、2 和 3）。

*Format*\
类型：DXGI\_FORMAT

一个 [DXGI\_FORMAT](https://learn.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format) 类型的值，指定元素数据的格式。

*InputSlot*\
类型：UINT

标识输入汇编器的整数值。有关详细信息，请参阅 [Input Slots](https://learn.microsoft.com/en-us/windows/desktop/direct3d11/d3d10-graphics-programming-guide-input-assembler-stage-getting-started)。有效值介于 0 到 15 之间。

*AlignedByteOffset*\
类型：UINT

可选。从顶点开始到此元素的偏移量（以字节为单位）。使用 D3D12\_APPEND\_ALIGNED\_ELEMENT (0xffffffff) 可方便地定义直接位于前一个元素之后的当前元素，包括必要的任何填充。

*InputSlotClass*\
类型：D3D12\_INPUT\_CLASSIFICATION

标识单个输入槽的输入数据类的值。

*InstanceDataStepRate*\
类型：UINT

在缓冲区中前进一个元素之前使用相同的每实例数据绘制的实例数。对于包含每顶点数据（槽类设置为 [D3D12\_INPUT\_CLASSIFICATION](/reference/graphics/d3d12/enums/d3d12_input_classification_public) 的 D3D12\_INPUT\_PER\_VERTEX\_DATA 成员）的元素，此值必须为 0。

## 备注

此结构是 [D3D12\_INPUT\_LAYOUT\_DESC](/reference/graphics/d3d12/structs/d3d12_input_layout_desc_public) 结构的成员。管线状态对象包含一个输入布局结构，该结构定义了从输入槽读取的一个元素。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h\
**库：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支持的平台**：XBOX Series 主机和 XBOX One 系列

## 另请参阅

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


## Related topics

- [D3D12_INPUT_LAYOUT_DESC](/zh-CN/reference/graphics/d3d12/structs/d3d12_input_layout_desc_public.md)
- [D3D12_INPUT_CLASSIFICATION](/zh-CN/reference/graphics/d3d12/enums/d3d12_input_classification_public.md)
- [D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS](/zh-CN/reference/graphics/d3d12/structs/d3d12_build_raytracing_acceleration_structure_inputs_public.md)
- [D3D12_RAYTRACING_GEOMETRY_DESC (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/structs/d3d12_raytracing_geometry_desc_public.md)
- [D3D12_RAYTRACING_GEOMETRY_AABBS_DESC (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/structs/d3d12_raytracing_geometry_aabbs_desc_public.md)
