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

◆ clear()

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

Clear buffer contents.

If the buffer is host-visible and mapped the memory is zeroed. For device-local buffers the backend must provide a ClearBufferProcessor that performs the appropriate GPU-side clear.

Implements MayaFlux::Buffers::Buffer.

Definition at line 33 of file VKBuffer.cpp.

34{
35 if (!is_initialized()) {
37 "Cannot clear uninitialized VKBuffer");
38 return;
39 }
40
42 std::memset(m_resources.mapped_ptr, 0, m_size_bytes);
43 } else {
45 "clear() on device-local buffer requires ClearBufferProcessor");
46 }
47}
#define MF_WARN(comp, ctx,...)
VKBufferResources m_resources
Definition VKBuffer.hpp:512
bool is_initialized() const
Check whether Vulkan handles are present (buffer registered)
Definition VKBuffer.hpp:246
bool is_host_visible() const
Whether this VKBuffer should be host-visible.
Definition VKBuffer.hpp:294
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferManagement, MayaFlux::Journal::Buffers, is_host_visible(), is_initialized(), m_resources, m_size_bytes, MayaFlux::Buffers::VKBufferResources::mapped_ptr, and MF_WARN.

Referenced by set_data().

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