> ## 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_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](/reference/graphics/d3d12_xs/enums/d3d12_buffer_uav_flags_xs)-typed value that specifies the view options for the resource.

## Remarks

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

If <i>StructureByteStride</i> 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 <i>StructureByteStride</i> 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)
