struct ConsumeStructuredBuffer<T, L>
Conditionally conforms to: __IDynamicResourceCastable<__DynamicResourceKind.General>
Description
Represents an opaque handle to a consume structured buffer allocated in global memory. A structured buffer can be viewed as an array of the specified element type. An append structure buffer internally maintains an atomic counter to keep track of the number of elements in the buffer, and provide an atomic operation to append a new element to the buffer.
Generic Parameters
T
The element type of the buffer.
L: IBufferDataLayout = DefaultDataLayout
The memory layout of the buffer.
Fields
kind : DescriptorKind = DescriptorKind.Buffer
Methods
Conditional Conformances
Conformance to __IDynamicResourceCastable<__DynamicResourceKind.General>
ConsumeStructuredBuffer<T, L>
additionally conforms to \_\_IDynamicResourceCastable\<\_\_DynamicResourceKind\.General\>
when the following conditions are met:
- L : IBufferDataLayout
Remarks
This type is supported natively when targeting HLSL. When generating code for other targets, this type is translated into a pair or an ordinary StructuredBuffer and a separate RWStructuredBuffer that holds the atomic counter. The L generic parameter is used to specify the memory layout of the buffer when generating SPIRV. L must be one of DefaultDataLayout, Std140DataLayout, Std430DataLayout or ScalarDataLayout. The default value is DefaultDataLayout. When generating code for other targets, this parameter is ignored and has no effect on the generated code.
See also
StructuredBuffer, AppendStructuredBuffer, RWStructuredBuffer, RasterizerOrderedStructuredBuffer.