docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ExchangeBuffer<T>

    Represents a synchronized collection in a CPU list and a GPU ComputeBuffer.

    Inheritance
    object
    ExchangeBuffer<T>
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)