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

> Describes a set of triangles used as raytracing geometry. The geometry pointed to by this struct are always in triangle list form, indexed or non-indexed.

Describes a set of triangles used as raytracing geometry. The geometry pointed to by this struct are always in triangle list form, indexed or non-indexed. Triangle strips are not supported.

## Syntax

```cpp theme={null}
typedef struct D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC
{
    D3D12_GPU_VIRTUAL_ADDRESS Transform3x4;
    DXGI_FORMAT IndexFormat;
    DXGI_FORMAT VertexFormat;
    UINT IndexCount;
    UINT VertexCount;
    D3D12_GPU_VIRTUAL_ADDRESS IndexBuffer;
    D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VertexBuffer;
} D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC
```

### Members

*Transform3x4*\
Type: D3D12\_GPU\_VIRTUAL\_ADDRESS

Address of a 3x4 affine transform matrix in row-major layout to be applied to the vertices in the <i>VertexBuffer</i> during an acceleration structure build.  The contents of <i>VertexBuffer</i> are not modified.  If a 2D vertex format is used, the transformation is applied with the third vertex component assumed to be zero.

If <i>Transform3x4</i> is NULL the vertices will not be transformed. Using <i>Transform3x4</i> may result in increased computation and/or memory requirements for the acceleration structure build.

The memory pointed to must be in state [D3D12\_RESOURCE\_STATE\_NON\_PIXEL\_SHADER\_RESOURCE](/reference/graphics/d3d12_x/enums/d3d12_resource_states).  The address must be aligned to 16 bytes, defined as [D3D12\_RAYTRACING\_TRANSFORM3X4\_BYTE\_ALIGNMENT](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/constants).

*IndexFormat*\
Type: DXGI\_FORMAT

Format of the indices in the <i>IndexBuffer</i>.  Must be one of the following:

<ul>
  <li>**DXGI\_FORMAT\_UNKNOWN** - when IndexBuffer is NULL</li>
  <li>**DXGI\_FORMAT\_R32\_UINT**</li>
  <li>**DXGI\_FORMAT\_R16\_UINT**</li>
</ul>

*VertexFormat*\
Type: DXGI\_FORMAT

Format of the vertices in <i>VertexBuffer</i>.  Must be one of the following:

<ul>
  <li>**DXGI\_FORMAT\_R32G32\_FLOAT** - third component is assumed 0</li>
  <li>**DXGI\_FORMAT\_R32G32B32\_FLOAT**</li>
  <li>**DXGI\_FORMAT\_R16G16\_FLOAT** - third component is assumed 0</li>
  <li>**DXGI\_FORMAT\_R16G16B16A16\_FLOAT**  - A16 component is ignored, other data can be packed there, such as setting vertex stride to 6 bytes.</li>
  <li>**DXGI\_FORMAT\_R16G16\_SNORM**  - third component is assumed 0</li>
  <li>**DXGI\_FORMAT\_R16G16B16A16\_SNORM**   - A16 component is ignored, other data can be packed there, such as setting vertex stride to 6 bytes.</li>
</ul>

Tier 1.1 devices support the following additional formats:

<ul>
  <li>**DXGI\_FORMAT\_R16G16B16A16\_UNORM**   - A16 component is ignored, other data can be packed there, such as setting vertex stride to 6 bytes</li>
  <li>**DXGI\_FORMAT\_R16G16\_UNORM**   - third component assumed 0</li>
  <li>**DXGI\_FORMAT\_R10G10B10A2\_UNORM**   - A2 component is ignored, stride must be 4 bytes</li>
  <li>**DXGI\_FORMAT\_R8G8B8A8\_UNORM**   - A8 component is ignored, other data can be packed there, such as setting vertex stride to 3 bytes</li>
  <li>**DXGI\_FORMAT\_R8G8\_UNORM**   - third component assumed 0</li>
  <li>**DXGI\_FORMAT\_R8G8B8A8\_SNORM**  - A8 component is ignored, other data can be packed there, such as setting vertex stride to 3 bytes</li>
  <li>**DXGI\_FORMAT\_R8G8\_SNORM**   - third component assumed 0</li>
</ul>

*IndexCount*\
Type: UINT

Number of indices in <i>IndexBuffer</i>.  Must be 0 if <i>IndexBuffer</i> is NULL.

*VertexCount*\
Type: UINT

Number of vertices in <i>VertexBuffer</i>.

*IndexBuffer*\
Type: D3D12\_GPU\_VIRTUAL\_ADDRESS

Array of vertex indices.  If NULL, triangles are non-indexed.  Just as with graphics, the address must be aligned to the size of <i>IndexFormat</i>.

The memory pointed to must be in state [D3D12\_RESOURCE\_STATE\_NON\_PIXEL\_SHADER\_RESOURCE](/reference/graphics/d3d12_x/enums/d3d12_resource_states).  Note that if an app wants to share index buffer inputs between graphics input assembler and raytracing acceleration structure build input, it can always put a resource into a combination of read states simultaneously, e.g. **D3D12\_RESOURCE\_STATE\_INDEX\_BUFFER** | **D3D12\_RESOURCE\_STATE\_NON\_PIXEL\_SHADER\_RESOURCE**.

*VertexBuffer*\
Type: D3D12\_GPU\_VIRTUAL\_ADDRESS\_AND\_STRIDE

Array of vertices including a stride.  The alignment on the address and stride must be a multiple of the component size, so 4 bytes for formats with 32bit components and 2 bytes for formats with 16bit components.  Unlike graphics, there is no constraint on the stride, other than that the bottom 32bits of the value are all that are used - the field is UINT64 purely to make neighboring fields align cleanly/obviously everywhere.  Each vertex position is expected to be at the start address of the stride range and any excess space is ignored by acceleration structure builds.  This excess space might contain other app data such as vertex attributes, which the app is responsible for manually fetching in shaders, whether it is interleaved in vertex buffers or elsewhere.

The memory pointed to must be in state [D3D12\_RESOURCE\_STATE\_NON\_PIXEL\_SHADER\_RESOURCE](/reference/graphics/d3d12_x/enums/d3d12_resource_states).  Note that if an app wants to share vertex buffer inputs between graphics input assembler and raytracing acceleration structure build input, it can always put a resource into a combination of read states simultaneously, e.g. **D3D12\_RESOURCE\_STATE\_VERTEX\_AND\_CONSTANT\_BUFFER** | **D3D12\_RESOURCE\_STATE\_NON\_PIXEL\_SHADER\_RESOURCE**

## Requirements

**Header:** d3d12\_xs.h\
**Library:** d3d12\_xs.lib\
**Supported Platforms**: XBOX Series consoles


## Related topics

- [D3D12_RAYTRACING_GEOMETRY_DESC (XBOX Series consoles)](/reference/graphics/d3d12/structs/d3d12_raytracing_geometry_desc_public.md)
- [D3D12_RAYTRACING_INSTANCE_FLAGS (XBOX Series consoles)](/reference/graphics/d3d12/enums/d3d12_raytracing_instance_flags_public.md)
- [GetRaytracingAccelerationStructurePrebuildInfo](/reference/graphics/d3d12/interfaces/id3d12device5/methods/id3d12device5_getraytracingaccelerationstructureprebuildinfo_public.md)
- [D3D12_RAYTRACING_GEOMETRY_TYPE (XBOX Series consoles)](/reference/graphics/d3d12/enums/d3d12_raytracing_geometry_type_public.md)
- [D3D12_RAYTRACING_GEOMETRY_FLAGS (XBOX Series consoles)](/reference/graphics/d3d12/enums/d3d12_raytracing_geometry_flags_public.md)
