bufinfo (sm5 - asm)

Query the element count on a buffer (but not the constant buffer).

bufinfo dest[.mask], srcResource
Item Description
dest
[in] The address of the results.
srcResource
[in] Buffer, other than a constant Buffer, in an SRV (t#) or UAV (u#).

Remarks

All components in dest receive the integer number of elements in the buffer s shader resource view. The number of elements depends on the view parameters such as memory format.

For a typed buffer SRV or UAV, the return value is the number of elements in the view (where an element is one unit of the typed format).

For a raw buffer SRV or UAV, the return value is the number of bytes in the view.

For a structured buffer SRV or UAV, the return value is the number of structures in the view.

This instruction applies to the following shader stages:

Vertex Hull Domain Geometry Pixel Compute
X X X X X X

Minimum Shader Model

This instruction is supported in the following shader models:

Shader Model Supported
Shader Model 5 yes
Shader Model 4.1 no
Shader Model 4 no
Shader Model 3 (DirectX HLSL) no
Shader Model 2 (DirectX HLSL) no
Shader Model 1 (DirectX HLSL) no

Shader Model 5 Assembly (DirectX HLSL)