docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method RequestAsyncReadback

    RequestAsyncReadback<T>(CommandBuffer, StructuredBuffer<T>, Action<NativeArray<T>>)

    Adds an asynchonous GPU readback request command to the command buffer.

    Declaration
    public static void RequestAsyncReadback<T>(this CommandBuffer cmd, StructuredBuffer<T> src, Action<NativeArray<T>> callback) where T : unmanaged
    Parameters
    Type Name Description
    CommandBuffer cmd

    The command buffer.

    StructuredBuffer<T> src

    The buffer to read the data from.

    Action<NativeArray<T>> callback

    A delegate called once the request is fullfilled.

    Type Parameters
    Name Description
    T

    The type of elements in the GPU buffer.

    Remarks

    IsEmpty must be false to call this function. If the request fails, the callback is not called.

    RequestAsyncReadback<T>(CommandBuffer, ExchangeBuffer<T>, Action)

    Adds to the command buffer an asynchonous request to readback from the GPU buffer into ExchangeBuffer CPU list.

    Declaration
    public static void RequestAsyncReadback<T>(this CommandBuffer cmd, ExchangeBuffer<T> src, Action callback) where T : unmanaged
    Parameters
    Type Name Description
    CommandBuffer cmd

    The command buffer.

    ExchangeBuffer<T> src

    The buffer to read the data from.

    Action callback

    A delegate called once the request is fullfilled.

    Type Parameters
    Name Description
    T

    The type of elements in the GPU buffer.

    Remarks

    IsEmpty must be false to call this function. If the request fails, the callback is not called.

    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)