Loading...
Searching...
No Matches
HdStStagingBuffer Class Reference

Provides a staging buffer for CPU writes of triple-buffered resources. More...

#include <stagingBuffer.h>

Public Member Functions

HDST_API HdStStagingBuffer (HdStResourceRegistry *resourceRegistry)
 
HDST_API void Deallocate ()
 Destroys contained HgiBuffers and resets state to empty.
 
HDST_API void Resize (size_t totalSize)
 Set the capacity for the staging buffer.
 
HDST_API void StageCopy (HgiBufferCpuToGpuOp const &copyOp)
 Submit a CPU to GPU copy operation to be added to the staging buffer.
 
HDST_API void Flush ()
 Flush the queued GPU to GPU blits from the calls to StageCopy.
 

Detailed Description

Provides a staging buffer for CPU writes of triple-buffered resources.

None of the function calls are thread safe, they should be only accessed from the commit call to ResourceRegistry.

Definition at line 49 of file stagingBuffer.h.

Member Function Documentation

◆ Deallocate()

HDST_API void Deallocate ( )

Destroys contained HgiBuffers and resets state to empty.

◆ Flush()

HDST_API void Flush ( )

Flush the queued GPU to GPU blits from the calls to StageCopy.

Resets the state for the next ResoureRegistry commit.

◆ Resize()

HDST_API void Resize ( size_t  totalSize)

Set the capacity for the staging buffer.

Only applied once first call to StageCopy is called. Cannot be called if there have already been calls to StageCopy for this commit.

◆ StageCopy()

HDST_API void StageCopy ( HgiBufferCpuToGpuOp const &  copyOp)

Submit a CPU to GPU copy operation to be added to the staging buffer.

The contents are memcpy'd over into the staging buffer during this call and a GPU to GPU blit is queued up to do the final copy to destination.


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