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

> Defines the inputs for a raytracing acceleration structure build operation. This structure is used by.

Defines the inputs for a raytracing acceleration structure build operation. This structure is used by [ID3D12GraphicsCommandList4::BuildRaytracingAccelerationStructure](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_buildraytracingaccelerationstructure_public) and [ID3D12Device5::GetRaytracingAccelerationStructurePrebuildInfo](/reference/graphics/d3d12/interfaces/id3d12device5/methods/id3d12device5_getraytracingaccelerationstructureprebuildinfo_public).

## Syntax

```cpp theme={null}
typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS
{
    D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type;
    D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags;
    UINT NumDescs;
    D3D12_ELEMENTS_LAYOUT DescsLayout;
    D3D12_GPU_VIRTUAL_ADDRESS InstanceDescs;
    const D3D12_RAYTRACING_GEOMETRY_DESC  pGeometryDescs;
    const D3D12_RAYTRACING_GEOMETRY_DESC const  ppGeometryDescs;
} D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS
```

### Members

*Type*\
Type: D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_TYPE

The type of acceleration structure to build.

*Flags*\
Type: D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_BUILD\_FLAGS

The build flags.

*NumDescs*\
Type: UINT

If <i>Type</i> is **D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_TOP\_LEVEL**, this value is the number of instances, laid out based on <i>DescsLayout</i>.

If <i>Type</i> is **D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_BOTTOM\_LEVEL**, this value is the number of elements referred to by <i>pGeometryDescs</i> or <i>ppGeometryDescs</i>. Which of these fields  is used depends on <i>DescsLayout</i>.

*DescsLayout*\
Type: D3D12\_ELEMENTS\_LAYOUT

How geometry descriptions are specified; either an array of descriptions or an array of pointers to descriptions.

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

If <i>Type</i> is **D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_TOP\_LEVEL**, this refers to <i>NumDescs</i>[D3D12\_RAYTRACING\_INSTANCE\_DESC](/reference/graphics/d3d12/structs/d3d12_raytracing_instance_desc_public) structures in GPU memory describing instances.  Each instance must be aligned to 16 bytes, defined as [D3D12\_RAYTRACING\_INSTANCE\_DESC\_BYTE\_ALIGNMENT](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/constants).

If <i>Type</i> is not **D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_TOP\_LEVEL**, this parameter is unused.

If <i>DescLayout</i> is **D3D12\_ELEMENTS\_LAYOUT\_ARRAY**, <i>InstanceDescs</i> points to an array of instance descriptions in GPU memory.

If <i>DescLayout</i> is **D3D12\_ELEMENTS\_LAYOUT\_ARRAY\_OF\_POINTERS**, <i>InstanceDescs</i> points to an array in GPU memory of [D3D12\_GPU\_VIRTUAL\_ADDRESS](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12_gpu_virtual_address) pointers to instance descriptions.

The memory pointed to must be in state [D3D12\_RESOURCE\_STATE\_NON\_PIXEL\_SHADER\_RESOURCE](/reference/graphics/d3d12_x/enums/d3d12_resource_states).

*pGeometryDescs*\
Type: const D3D12\_RAYTRACING\_GEOMETRY\_DESC \*

If <i>Type</i> is **D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_BOTTOM\_LEVEL**, and <i>DescsLayout</i> is **D3D12\_ELEMENTS\_LAYOUT\_ARRAY**, this field is used and points to <i>NumDescs</i> contiguous **D3D12\_RAYTRACING\_GEOMETRY\_DESC** structures on the CPU, describing individual geometries.

If <i>Type</i> is not **D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_BOTTOM\_LEVEL** or <i>DescsLayout</i> is not **D3D12\_ELEMENTS\_LAYOUT\_ARRAY**, this parameter is unused.

*ppGeometryDescs*\
Type: const D3D12\_RAYTRACING\_GEOMETRY\_DESC \*const \*

If <i>Type</i> is **D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_BOTTOM\_LEVEL**, and <i>DescsLayout</i> is **D3D12\_ELEMENTS\_LAYOUT\_ARRAY\_OF\_POINTERS**, this field is used and points to an array of <i>NumDescs</i> pointers to [D3D12\_RAYTRACING\_GEOMETRY\_DESC](/reference/graphics/d3d12/structs/d3d12_raytracing_geometry_desc_public) structures on the CPU, describing individual geometries.

## Remarks

When used with  [GetRaytracingAccelerationStructurePrebuildInfo](/reference/graphics/d3d12/interfaces/id3d12device5/methods/id3d12device5_getraytracingaccelerationstructureprebuildinfo_public), which actually perform a build, any parameter that is referenced via [D3D12\_GPU\_VIRTUAL\_ADDRESS](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12_gpu_virtual_address) (an address in GPU memory), like <i>InstanceDescs</i>, will not be accessed by the operation.  So this memory does not need to be initialized yet or be in a particular resource state.  Whether GPU addresses are null or not can be inspected by the operation, even though the pointers are not dereferenced.

## Requirements

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


## Related topics

- [D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC](/reference/graphics/d3d12/structs/d3d12_build_raytracing_acceleration_structure_desc_public.md)
- [GetRaytracingAccelerationStructurePrebuildInfo](/reference/graphics/d3d12/interfaces/id3d12device5/methods/id3d12device5_getraytracingaccelerationstructureprebuildinfo_public.md)
- [D3D12_RAYTRACING_GEOMETRY_DESC (XBOX Series consoles)](/reference/graphics/d3d12/structs/d3d12_raytracing_geometry_desc_public.md)
- [D3D12_RAYTRACING_GEOMETRY_AABBS_DESC (XBOX Series consoles)](/reference/graphics/d3d12/structs/d3d12_raytracing_geometry_aabbs_desc_public.md)
- [D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO](/reference/graphics/d3d12/structs/d3d12_raytracing_acceleration_structure_prebuild_info_public.md)
