MayaFlux 0.2.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 36 of file VKBuffer.cpp.

37{
38 if (!is_initialized()) {
40 "Cannot clear uninitialized VKBuffer");
41 return;
42 }
43
45 std::memset(m_resources.mapped_ptr, 0, m_size_bytes);
46 } else {
48 "clear() on device-local buffer requires ClearBufferProcessor");
49 }
50}
#define MF_WARN(comp, ctx,...)
VKBufferResources m_resources
Definition VKBuffer.hpp:447
bool is_initialized() const
Check whether Vulkan handles are present (buffer registered)
Definition VKBuffer.hpp:244
bool is_host_visible() const
Whether this VKBuffer should be host-visible.
Definition VKBuffer.hpp:292
@ 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(), and ~VKBuffer().

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