Class ExchangeBuffer<T>
Represents a synchronized collection in a CPU list and a GPU ComputeBuffer.
Inherited Members
Namespace: Mechatronics.SensorSDK
Assembly: solution.dll
Syntax
public class ExchangeBuffer<T> where T : unmanaged
Type Parameters
Name | Description |
---|---|
T | The type of elements in the ComputeBuffer. Must be blittable. |
Constructors
Name | Description |
---|---|
ExchangeBuffer(string) | Initializes and returns an instance of ExchangeBuffer. |
Properties
Name | Description |
---|---|
Buffer | The underlying compute buffer. Can be null if IsEmpty is true (Read Only). |
Count | The number of valid elements in the buffer (Read Only). |
IsEmpty | Indicates there are no valid elements in the buffer (Read Only). |
List | The CPU list (Read Only). Never null. |
ModificationUid | An identifier of the current state. Can be used to detect if the list has changed (Read Only). |
Stride | The size in bytes of a single element (Read Only). |
Methods
Name | Description |
---|---|
CopyFrom(IEnumerable<T>, CommandBuffer) | Copies the data to the CPU list, then sends the given data to the GPU buffer, allocating or resizing it if necessary. |
GetDataAsync(CommandBuffer, Action) | Gets data from the GPU buffer into the CPU list asynchronously, via a command buffer. |
Release() | Releases the underlying ComputeBuffer and clears the CPU list. |
UseList(List<T>, CommandBuffer) | Sets the internal CPU list to refer to the given one, then sends the list to the GPU buffer, allocating or resizing it if necessary. |