#include <RadientTesseraBufferSuballocator.hpp>
Public Member Functions | |
| RadientTesseraBufferAllocation | Allocate (Uint32 Size, const void *pInitialData=nullptr) |
| RADIENT_STATUS | Update (const RadientTesseraBufferAllocation &Allocation, Uint32 RelativeOffset, const void *pData, Uint32 Size) |
| RADIENT_STATUS | Update (const RadientTesseraBufferAllocation &Allocation, Uint32 RelativeOffset, Uint32 Size, UpdateCallbackType UpdateData, void *pUserData=nullptr) |
| RADIENT_STATUS | Prepare (IRenderDevice *pDevice, IDeviceContext *pContext) |
Thread-safe allocator, CPU shadow, and render-thread GPU uploader for persistent Tessera buffer regions. Stable allocation offsets survive buffer growth, while the buffer version identifies replacement GPU buffers.
| RadientTesseraBufferAllocation Diligent::RadientTesseraBufferSuballocator::Allocate | ( | Uint32 | Size, |
| const void * | pInitialData = nullptr ) |
Allocates an aligned region. If pInitialData is not null, Size bytes are copied into the CPU shadow. Otherwise, the allocation remains pending until Update() populates it. This method may be called concurrently from worker threads.
| RADIENT_STATUS Diligent::RadientTesseraBufferSuballocator::Prepare | ( | IRenderDevice * | pDevice, |
| IDeviceContext * | pContext ) |
Creates or grows the GPU buffer and uploads all dirty regions. This method must only be called from the render thread.
| RADIENT_STATUS Diligent::RadientTesseraBufferSuballocator::Update | ( | const RadientTesseraBufferAllocation & | Allocation, |
| Uint32 | RelativeOffset, | ||
| const void * | pData, | ||
| Uint32 | Size ) |
Replaces a byte range in an existing allocation and marks it for upload. RelativeOffset is measured from the start of Allocation, not from the start of the shared buffer. The allocation remains at the same buffer offset and becomes pending until Prepare() uploads the new generation. An empty range is accepted as a successful no-op and pData may be null in that case.
| RADIENT_STATUS Diligent::RadientTesseraBufferSuballocator::Update | ( | const RadientTesseraBufferAllocation & | Allocation, |
| Uint32 | RelativeOffset, | ||
| Uint32 | Size, | ||
| UpdateCallbackType | UpdateData, | ||
| void * | pUserData = nullptr ) |
Invokes UpdateData synchronously with direct access to a range in the allocation's CPU shadow. The range is marked for upload only when the callback returns RADIENT_STATUS_OK. The callback executes while the allocator is locked and must not call back into this allocator.