|
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 ©Op) |
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. | |
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.
HDST_API void Deallocate | ( | ) |
Destroys contained HgiBuffers and resets state to empty.
HDST_API void Flush | ( | ) |
Flush the queued GPU to GPU blits from the calls to StageCopy.
Resets the state for the next ResoureRegistry commit.
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.
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.