Class StructuredBuffer<T>
Provides a user-friendly and safe interface over ComputeBuffer.
Inherited Members
Namespace: Mechatronics.SensorSDK
Assembly: solution.dll
Syntax
public class StructuredBuffer<T> where T : unmanaged
Type Parameters
| Name | Description |
|---|---|
| T | The type of elements in the ComputeBuffer. Must be blittable. |
Constructors
| Name | Description |
|---|---|
| StructuredBuffer(string) | Initializes and returns an instance of StructuredBuffer. |
Properties
| Name | Description |
|---|---|
| Capacity | The allocated number of elements of the underlying buffer. Never smaller than Count (Read Only). |
| Count | The logical number of elements of the underlying buffer (Read Only). |
| IsEmpty | Indicates there are no valid elements in the buffer (Read Only). |
| Name | An optional debug label for the compute buffer. |
| Stride | The size in bytes of a single element (Read Only). |
Methods
| Name | Description |
|---|---|
| GetDataAsync(CommandBuffer, Action<NativeArray<T>>) | Gets data from the GPU buffer asynchronously, via a command buffer. |
| Release() | Releases the underlying ComputeBuffer. |
| Resize(int, ResizeOptions) | Reallocates the underlying buffer if necessary, depending on the given options. |
| SetData(List<T>, ResizeOptions, CommandBuffer) | Sends the given data to the GPU buffer, allocating or resizing it if necessary. |
Operators
| Name | Description |
|---|---|
| explicit operator ComputeBuffer(StructuredBuffer<T>) | Gets the underlying compute buffer. Can be null if IsEmpty is true. |