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

> Describes the elements in a buffer resource to use in a shader-resource view.

Describes the elements in a buffer resource to use in a shader-resource view.

## Syntax

```cpp theme={null}
typedef struct D3D12_BUFFER_SRV
{
    UINT64 FirstElement;
    UINT NumElements;
    UINT StructureByteStride;
    D3D12_BUFFER_SRV_FLAGS Flags;
} D3D12_BUFFER_SRV
```

### Members

*FirstElement*\
Type: UINT64

The index of the first element to be accessed by the view.

*NumElements*\
Type: UINT

The number of elements in the resource.

*StructureByteStride*\
Type: UINT

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

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

A [D3D12\_BUFFER\_SRV\_FLAGS](/reference/graphics/d3d12_xs/enums/d3d12_buffer_srv_flags_xs)-typed value that identifies view options for the buffer. Currently, the only option is to identify a raw view of the buffer. For more info about raw viewing of buffers, see [Raw Views of Buffers](https://learn.microsoft.com/en-us/windows/desktop/direct3d11/overviews-direct3d-11-resources-intro).

## Remarks

This structure is used by [D3D12\_SHADER\_RESOURCE\_VIEW\_DESC](/reference/graphics/d3d12/structs/d3d12_shader_resource_view_desc_public) to create a view of a buffer.

If the value of *StructureByteStride* is not 0, then a view of a structured buffer is created, and then the *D3D12\_SHADER\_RESOURCE\_VIEW\_DESC::Format* field must be **DXGI\_FORMAT\_UNKNOWN**. If *StructureByteStride* is 0, then a typed view of a buffer is created, and then a format must be supplied. The specified format for the typed view must be supported by the hardware.

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


## Related topics

- [D3D12_SHADER_RESOURCE_VIEW_DESC](/reference/graphics/d3d12/structs/d3d12_shader_resource_view_desc_public.md)
- [D3D12_DESCRIPTOR_RANGE_TYPE](/reference/graphics/d3d12/enums/d3d12_descriptor_range_type_public.md)
- [D3D12_ROOT_PARAMETER_TYPE](/reference/graphics/d3d12/enums/d3d12_root_parameter_type_public.md)
- [D3D12_TEXCUBE_SRV](/reference/graphics/d3d12/structs/d3d12_texcube_srv_public.md)
- [D3D12_TEX1D_SRV](/reference/graphics/d3d12/structs/d3d12_tex1d_srv_public.md)
