docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ThreadedSparseUploader

    An unmanaged and Burst-compatible interface for SparseUploader.

    Namespace: Unity.Rendering
    Assembly: Unity.Entities.Graphics.dll
    Syntax
    public struct ThreadedSparseUploader
    Remarks

    This should be created each frame by a call to SparseUploader.Begin and is later returned by a call to SparseUploader.EndAndCommit.

    Properties

    IsValid

    Indicates whether the SparseUploader is valid and can be used.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    bool

    Methods

    AddMatrixUpload(void*, int, int, MatrixType, MatrixType)

    Adds a new pending matrix upload operation to execute when you call SparseUploader.EndAndCommit.

    Declaration
    public void AddMatrixUpload(void* src, int numMatrices, int offset, ThreadedSparseUploader.MatrixType srcType, ThreadedSparseUploader.MatrixType dstType)
    Parameters
    Type Name Description
    void* src

    A pointer to a memory area that contains matrices of the type specified by srcType.

    int numMatrices

    The number of matrices to upload.

    int offset

    The destination offset of the copy part of the upload operation.

    ThreadedSparseUploader.MatrixType srcType

    The source matrix format.

    ThreadedSparseUploader.MatrixType dstType

    The destination matrix format.

    Remarks

    When this operation executes, the SparseUploader copies data from the source pointer.

    AddMatrixUploadAndInverse(void*, int, int, int, MatrixType, MatrixType)

    Adds a new pending matrix upload operation to execute when you call SparseUploader.EndAndCommit.

    Declaration
    public void AddMatrixUploadAndInverse(void* src, int numMatrices, int offset, int offsetInverse, ThreadedSparseUploader.MatrixType srcType, ThreadedSparseUploader.MatrixType dstType)
    Parameters
    Type Name Description
    void* src

    A pointer to a memory area that contains matrices of the type specified by srcType.

    int numMatrices

    The number of matrices to upload.

    int offset

    The destination offset of the copy part of the upload operation.

    int offsetInverse

    The destination offset of the inverse part of the upload operation.

    ThreadedSparseUploader.MatrixType srcType

    The source matrix format.

    ThreadedSparseUploader.MatrixType dstType

    The destination matrix format.

    Remarks

    When this operation executes, the SparseUploader copies data from the source pointer.

    The upload operation automatically inverts matrices during the upload operation and it then stores the inverted matrices in a separate offset in the GPU buffer.

    AddStridedUpload(void*, uint, uint, uint, uint, int)

    Adds a new pending upload operation to execute when you call SparseUploader.EndAndCommit.

    Declaration
    public void AddStridedUpload(void* src, uint elemSize, uint srcStride, uint count, uint dstOffset, int dstStride)
    Parameters
    Type Name Description
    void* src

    The source data pointer.

    uint elemSize

    The size of each data element to upload.

    uint srcStride

    The stride of each data element as stored in the source pointer.

    uint count

    The number of data elements to upload.

    uint dstOffset

    The destination offset

    int dstStride

    The destination stride

    Remarks

    When this operation executes, the SparseUploader copies data from the source pointer.

    The upload operations reads data with the specified source stride from the source pointer and then stores the data with the specified destination stride.

    AddUpload(void*, int, int, int)

    Adds a new pending upload operation to execute when you call SparseUploader.EndAndCommit.

    Declaration
    public void AddUpload(void* src, int size, int offsetInBytes, int repeatCount = 1)
    Parameters
    Type Name Description
    void* src

    The source pointer of data to upload.

    int size

    The amount of data, in bytes, to read from the source pointer.

    int offsetInBytes

    The destination offset of the data in the GPU buffer.

    int repeatCount

    The number of times to repeat the source data in the destination buffer when uploading.

    Remarks

    When this operation executes, the SparseUploader copies data from the source pointer.

    AddUpload<T>(NativeArray<T>, int, int)

    Adds a new pending upload operation to execute when you call SparseUploader.EndAndCommit.

    Declaration
    public void AddUpload<T>(NativeArray<T> array, int offsetInBytes, int repeatCount = 1) where T : unmanaged
    Parameters
    Type Name Description
    NativeArray<T> array

    The source array of data to upload.

    int offsetInBytes

    The destination offset of the data in the GPU buffer.

    int repeatCount

    The number of times to repeat the source data in the destination buffer when uploading.

    Type Parameters
    Name Description
    T

    Any unmanaged simple type.

    Remarks

    When this operation executes, the SparseUploader copies data from the source array.

    AddUpload<T>(T, int, int)

    Adds a new pending upload operation to execute when you call SparseUploader.EndAndCommit.

    Declaration
    public void AddUpload<T>(T val, int offsetInBytes, int repeatCount = 1) where T : unmanaged
    Parameters
    Type Name Description
    T val

    The source data to upload.

    int offsetInBytes

    The destination offset of the data in the GPU buffer.

    int repeatCount

    The number of times to repeat the source data in the destination buffer when uploading.

    Type Parameters
    Name Description
    T

    Any unmanaged simple type.

    Remarks

    When this operation executes, the SparseUploader copies data from the source value.

    In This Article
    Back to top
    Copyright © 2025 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)