Unigine.StructuredBuffer Class
StructuredBuffer is a buffer for structures: it represents a uniform array of structures.
StructuredBuffer resource can specified via the following flags:
- GPU_RESOURCE specifies a resource that can be read and written by the GPU. It also creates a temporary direct staging buffer to copy the data from the main buffer and gets the data by the CPU.
- IMMUTABLE specifies a resources that can only be read by the GPU. It also creates a temporary direct staging buffer to copy the data from the main buffer and gets the data by the CPU.
- CPU_RESOURCE specifies a resource that is accessible by both the GPU (read only mode) and the CPU (write only mode). It also creates a temporary direct staging buffer to copy the data from the main buffer and gets the data by the CPU.
- STAGING specifies a resource that supports direct data transfer from the GPU to CPU.
See Also#
- StructuredBuffer C++ sample provided in the Samples (Samples -> C++ -> Render) section of UNIGINE SDK Browser.
StructuredBuffer Class
Members
IntPtr GetD3D11ShaderResourceView ( ) #
Gets a shader-resource view that specifies the subresources a shader can access during rendering.Return value
A pointer to D3D11 shader resource view.IntPtr GetD3D11UnorderedAccessView ( ) #
Gets a view for an unordered access resource that specifies the parts of a resource the pipeline can access during rendering.Return value
A pointer to a D3D11 unordered access view.int GetData ( IntPtr data ) #
Gets the data from StructuredBuffer instance.Arguments
- IntPtr data - A pointer to the data.
Return value
1 if StructuredBuffer data was returned; otherwise, 0.int GetGLBufferID ( ) #
Returns the Id of buffer.Return value
An Id of the buffer.void BindCompute ( int unit ) #
Binds the StructuredBuffer to the compute shader type.Arguments
- int unit - Number of the slot.
void UnbindCompute ( int unit ) #
Unbinds the StructuredBuffer from the compute shader type.Arguments
- int unit - Number of the slot.
void BindControl ( int unit ) #
Binds the StructuredBuffer to the tesselation control (hull) shader type.Arguments
- int unit - Number of the slot.
void UnbindControl ( int unit ) #
Unbinds the StructuredBuffer from the tesselation control (hull) shader type.Arguments
- int unit - Number of the slot.
void BindEvaluate ( int unit ) #
Binds the StructuredBuffer to the tesselation evaluation (domain) shader type.Arguments
- int unit - Number of the slot.
void UnbindEvaluate ( int unit ) #
Unbinds the StructuredBuffer from the tesselation evaluation (domain) shader type.Arguments
- int unit - Number of the slot.
void BindFragment ( int unit ) #
Binds the StructuredBuffer to the fragment shader type.Arguments
- int unit - Number of the slot.
void UnbindFragment ( int unit ) #
Unbinds the StructuredBuffer from the fragment shader type.Arguments
- int unit - Number of the slot.
void BindGeometry ( int unit ) #
Binds the StructuredBuffer to the geometry shader type.Arguments
- int unit - Number of the slot.
void UnbindGeometry ( int unit ) #
Unbinds the StructuredBuffer from the geometry shader type.Arguments
- int unit - Number of the slot.
void BindVertex ( int unit ) #
Binds the StructuredBuffer to the vertex shader type.Arguments
- int unit - Number of the slot.
void Clear ( ) #
Clears smart pointer.StructuredBuffer Create ( ) #
Creates a smart pointer to the StructuredBuffer.StructuredBufferPtr input_buffer = StructuredBuffer::create();
int Create ( int flags, IntPtr data, uint structure_size, uint num_elements ) #
Arguments
- int flags - StructuredBuffer flag.
- IntPtr data - Pointer to the source data.
- uint structure_size - The size of the structured buffer.
- uint num_elements - Number of elements in structured buffer.
Return value
1 if the StructuredBuffer was created successfully; otherwise, 0.int Create ( int flags, uint structure_size, uint num_elements ) #
Constructor. Creates a new structured buffer with the specified parameters.Arguments
- int flags - StructuredBuffer flag.
- uint structure_size - The size of the structured buffer.
- uint num_elements - Number of elements in structured buffer.
Return value
1 if the StructuredBuffer was created successfully; otherwise, 0.void Destroy ( ) #
Destroys smart pointer.void UnbindVertex ( int unit ) #
Unbinds the StructuredBuffer from the vertex shader type.Arguments
- int unit - Number of the slot.
Last update:
2019-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)