docs.unity3d.com
    Show / Hide Table of Contents

    Class CaptureGPUBuffer

    Inheritance
    Object
    CaptureGPUBuffer
    Namespace: Unity.Simulation
    Syntax
    public static class CaptureGPUBuffer

    Methods

    Capture<T>(ComputeBuffer, Func<AsyncRequest<Object>, AsyncRequest.Result>)

    Perform async read back from the provided compute buffer

    Declaration
    public static AsyncRequest<object> Capture<T>(ComputeBuffer src, Func<AsyncRequest<object>, AsyncRequest.Result> functor = null)
        where T : struct
    Parameters
    Type Name Description
    ComputeBuffer src

    Compute buffer source to be used for the read back.

    Func<AsyncRequest<Object>, AsyncRequest.Result> functor

    Functor that will be invoked after the async read back request is complete.

    Returns
    Type Description
    AsyncRequest<Object>

    Returns an AsyncRequest

    Type Parameters
    Name Description
    T

    Type for the destination data buffer.

    Capture<T>(ComputeBuffer, Int32, Int32, Func<AsyncRequest<Object>, AsyncRequest.Result>)

    Perform async read back from the provided compute buffer with size and offset.

    Declaration
    public static AsyncRequest<object> Capture<T>(ComputeBuffer src, int size, int offset, Func<AsyncRequest<object>, AsyncRequest.Result> functor = null)
        where T : struct
    Parameters
    Type Name Description
    ComputeBuffer src

    Compute buffer source to be used for the read back.

    Int32 size

    Size in bytes of the data to be retrieved from the ComputeBuffer.

    Int32 offset

    Offset in bytes in the ComputeBuffer.

    Func<AsyncRequest<Object>, AsyncRequest.Result> functor

    Functor that will be invoked after the async read back request is complete.

    Returns
    Type Description
    AsyncRequest<Object>

    Returns an AsyncRequest

    Type Parameters
    Name Description
    T

    Type for the destination data buffer.

    Capture<T>(Texture, Int32, Func<AsyncRequest<Object>, AsyncRequest.Result>)

    Perform async read back from the provided source texture.

    Declaration
    public static AsyncRequest<object> Capture<T>(Texture src, int mipIndex = 0, Func<AsyncRequest<object>, AsyncRequest.Result> functor = null)
        where T : struct
    Parameters
    Type Name Description
    Texture src

    Texture source to be used for the read back.

    Int32 mipIndex

    Index of the mipmap to be fetched.

    Func<AsyncRequest<Object>, AsyncRequest.Result> functor

    Functor that will be invoked after the async read back request is complete.

    Returns
    Type Description
    AsyncRequest<Object>

    Returns an AsyncRequest

    Type Parameters
    Name Description
    T

    Type for the destination data buffer.

    Capture<T>(Texture, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Func<AsyncRequest<Object>, AsyncRequest.Result>)

    Perform async read back from the provided source texture.

    Declaration
    public static AsyncRequest<object> Capture<T>(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, Func<AsyncRequest<object>, AsyncRequest.Result> functor = null)
        where T : struct
    Parameters
    Type Name Description
    Texture src

    Texture source to be used for the read back.

    Int32 mipIndex

    Index of the mipmap to be fetched.

    Int32 x

    Starting X coordinate in pixels of the Texture data to be fetched.

    Int32 width

    Width in pixels of the Texture data to be fetched.

    Int32 y

    Starting Y coordinate in pixels of the Texture data to be fetched.

    Int32 height

    Height in pixels of the Texture data to be fetched.

    Int32 z

    Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched.

    Int32 depth

    Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray.

    Func<AsyncRequest<Object>, AsyncRequest.Result> functor

    Functor that will be invoked after the async read back request is complete.

    Returns
    Type Description
    AsyncRequest<Object>
    Type Parameters
    Name Description
    T

    Type for the destination data buffer.

    Capture<T>(Texture, Int32, GraphicsFormat, Func<AsyncRequest<Object>, AsyncRequest.Result>)

    Perform async read back from the provided source texture.

    Declaration
    public static AsyncRequest<object> Capture<T>(Texture src, int mipIndex, GraphicsFormat dstFormat, Func<AsyncRequest<object>, AsyncRequest.Result> functor = null)
        where T : struct
    Parameters
    Type Name Description
    Texture src

    Texture source to be used for the read back.

    Int32 mipIndex

    Index of the mipmap to be fetched.

    GraphicsFormat dstFormat

    Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic.

    Func<AsyncRequest<Object>, AsyncRequest.Result> functor

    Functor that will be invoked after the async read back request is complete.

    Returns
    Type Description
    AsyncRequest<Object>

    Returns an AsynRequest

    Type Parameters
    Name Description
    T

    Type for the destination data buffer.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023