Struct ThreadedSparseUploader
An unmanaged and Burst-compatible interface for SparseUploader.
Namespace: Unity.Rendering
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 readonly bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
AddMatrixUpload(Void*, Int32, Int32, ThreadedSparseUploader.MatrixType, ThreadedSparseUploader.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. |
Int32 | numMatrices | The number of matrices to upload. |
Int32 | 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*, Int32, Int32, Int32, ThreadedSparseUploader.MatrixType, ThreadedSparseUploader.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. |
Int32 | numMatrices | The number of matrices to upload. |
Int32 | offset | The destination offset of the copy part of the upload operation. |
Int32 | 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*, UInt32, UInt32, UInt32, UInt32, Int32)
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. |
UInt32 | elemSize | The size of each data element to upload. |
UInt32 | srcStride | The stride of each data element as stored in the source pointer. |
UInt32 | count | The number of data elements to upload. |
UInt32 | dstOffset | The destination offset |
Int32 | 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*, Int32, Int32, Int32)
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. |
Int32 | size | The amount of data, in bytes, to read from the source pointer. |
Int32 | offsetInBytes | The destination offset of the data in the GPU buffer. |
Int32 | 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>(T, Int32, Int32)
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 : struct
Parameters
Type | Name | Description |
---|---|---|
T | val | The source data to upload. |
Int32 | offsetInBytes | The destination offset of the data in the GPU buffer. |
Int32 | 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.
AddUpload<T>(NativeArray<T>, Int32, Int32)
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 : struct
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | array | The source array of data to upload. |
Int32 | offsetInBytes | The destination offset of the data in the GPU buffer. |
Int32 | 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.