MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ clear()

void MayaFlux::Buffers::VKBuffer::clear ( )
overridevirtual

Clear buffer contents.

Zeroes the contents in place. Mapped buffers are cleared on the host; unmapped (device-local) buffers are cleared on the GPU and the call blocks until the fill completes. Handles and addresses are unchanged. Requires the buffer to be registered and, when unmapped, to have been created with transfer destination usage.

Implements MayaFlux::Buffers::Buffer.

Definition at line 38 of file VKBuffer.cpp.

39{
40 if (!is_initialized()) {
42 "clear() on VKBuffer with no GPU resources: nothing to clear");
43 return;
44 }
45
46 clear_gpu_buffer(std::static_pointer_cast<VKBuffer>(shared_from_this()));
47}
#define MF_TRACE(comp, ctx,...)
bool is_initialized() const
Check whether Vulkan handles are present (buffer registered)
Definition VKBuffer.hpp:283
bool clear_gpu_buffer(const std::shared_ptr< VKBuffer > &target)
Zero a registered GPU buffer in place (auto-detects host-visible vs device-local)
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferManagement, MayaFlux::Journal::Buffers, MayaFlux::Buffers::clear_gpu_buffer(), is_initialized(), and MF_TRACE.

Referenced by set_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: