All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiCopyResourceOp Struct Reference

Describes the properties needed to copy resource data to/from GPU/CPU. More...

Public Attributes

HgiFormat format
 
HgiTextureUsageBits usage
 
GfVec3i dimensions
 
GfVec3i sourceByteOffset
 
union {
HgiTextureHandle gpuSourceTexture
 
void * cpuSourceBuffer
 
}; 
 
GfVec3i destinationByteOffset
 
size_t destinationBufferByteSize
 
union {
HgiTextureHandle gpuDestinationTexture
 
void * cpuDestinationBuffer
 
}; 
 

Detailed Description

Describes the properties needed to copy resource data to/from GPU/CPU.

  • ensure the source and destination buffers are valid by the time the - insert the appropriate barriers in the command buffer prior to reading/writing to/from the buffers.
  • format: The data-type of one element in the source buffer
  • usage: For some platforms knowing the format may not be enough and needs to know if the source/destination is used for e.g. Depth.
  • dimensions: Size of data (in element count) to copy from source to destination.
  • sourceByteOffset: The offset in source buffer where to start copying the data from. For a 2 or 3 dimensionaly buffer you can supply offset[1] and offset[2].
  • sourceBuffer: Where to copy the data from (gpu or cpu)

  • destinationByteOffset: The offset in destination buffer where to start copying the data to. For a 2 or 3 dimensionaly buffer you can supply offset[1] and offset[2].
  • destinationBufferByteSize: Size of the destination buffer (in bytes)
  • destinationBuffer: Where to copy the data to (gpu or cpu)

It is the responsibility of the caller to:

  • ensure the destination buffer is large enough to receive the data

Definition at line 75 of file blitEncoderOps.h.


The documentation for this struct was generated from the following file: