> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# D3D12_BUFFER_UAV

> Describes the elements in a buffer to use in a unordered-access view. (D3D12_BUFFER_UAV)

Describes the elements in a buffer to use in a unordered-access view.

## Syntax

```cpp theme={null}
typedef struct D3D12_BUFFER_UAV
{
    UINT64 FirstElement;
    UINT NumElements;
    UINT StructureByteStride;
    UINT64 CounterOffsetInBytes;
    D3D12_BUFFER_UAV_FLAGS Flags;
} D3D12_BUFFER_UAV
```

### Members

*FirstElement*\
Type: UINT64

The zero-based index of the first element to be accessed.

*NumElements*\
Type: UINT

The number of elements in the resource. For structured buffers, this is the number of structures in the buffer.

*StructureByteStride*\
Type: UINT

The size of each element in the buffer structure (in bytes) when the buffer represents a structured buffer.

*CounterOffsetInBytes*\
Type: UINT64

The counter offset, in bytes.

*Flags*\
Type: D3D12\_BUFFER\_UAV\_FLAGS

A [D3D12\_BUFFER\_UAV\_FLAGS](https://docs.xbox.com/reference/graphics/d3d12_xs/enums/d3d12_buffer_uav_flags_xs.md)-typed value that specifies the view options for the resource.

## Remarks

Use this structure with a [D3D12\_UNORDERED\_ACCESS\_VIEW\_DESC](https://docs.xbox.com/reference/graphics/d3d12/structs/d3d12_unordered_access_view_desc_public.md) structure to view the resource as a buffer.

If *StructureByteStride* value is not 0, a view of a structured buffer is created and the D3D12\_UNORDERED\_ACCESS\_VIEW\_DESC::Format field must be DXGI\_FORMAT\_UNKNOWN. If *StructureByteStride* is 0, a typed view of a buffer is created and a format must be supplied. The specified format for the typed view must be supported by the hardware. More information on this topic can be found in the [Typed unordered access view (UAV) loads](https://learn.microsoft.com/en-us/windows/win32/direct3d12/typed-unordered-access-view-loads) page.

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

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

[Typed unordered access view (UAV) loads](https://learn.microsoft.com/en-us/windows/win32/direct3d12/typed-unordered-access-view-loads)


## Related topics

- [D3D12_UNORDERED_ACCESS_VIEW_DESC](https://docs.xbox.com/reference/graphics/d3d12/structs/d3d12_unordered_access_view_desc_public.md)
- [D3D12_UAV_DIMENSION](https://docs.xbox.com/reference/graphics/d3d12/enums/d3d12_uav_dimension_public.md)
- [D3D12_DESCRIPTOR_RANGE_TYPE](https://docs.xbox.com/reference/graphics/d3d12/enums/d3d12_descriptor_range_type_public.md)
- [D3D12_ROOT_PARAMETER_TYPE](https://docs.xbox.com/reference/graphics/d3d12/enums/d3d12_root_parameter_type_public.md)
- [D3D12_TEX3D_UAV](https://docs.xbox.com/reference/graphics/d3d12/structs/d3d12_tex3d_uav_public.md)
