class GpuBuffer

book_4_sparkGenerated
code_blocksInput

Description

The GpuBuffer class in the Sandbox namespace is a GPU data buffer designed for use with a ComputeShader. It allows for reading and writing arbitrary data between the CPU and GPU, facilitating efficient parallel data processing on the GPU. The buffer type can vary based on the specified UsageFlags, with the default being Structured, which maps to StructuredBuffer<T> and RWStructuredBuffer<T> in HLSL.

Members

Instance Members

Member Name Summary
Dispose Destroys the GPU buffer, don't use it no more
GetData Retrieves data from the GPU buffer into a span.
GetData Retrieves a specified range of data from the GPU buffer into a span.
SetData Sets data in the GPU buffer from a span.
SetData Sets data in the GPU buffer from a list.
CopyStructureCount Copies the structure count from one buffer to another.
SetCounterValue Sets the counter value for the buffer.
ElementCount Number of elements in the buffer.
ElementSize Size of a single element in the buffer.
Usage What sort of buffer this is.
IsValid Indicates whether the buffer is valid.