MayaFlux 0.1.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 37 of file VKBuffer.cpp.

38{
39 if (!is_initialized()) {
41 "Cannot clear uninitialized VKBuffer");
42 return;
43 }
44
46 std::memset(m_resources.mapped_ptr, 0, m_size_bytes);
47 // Flush handled by backend
48 } else {
49 // Device-local clear requires command buffer
50 // Backend/processor handles this
52 "clear() on device-local buffer requires ClearBufferProcessor");
53 }
54}
#define MF_WARN(comp, ctx,...)
VKBufferResources m_resources
Definition VKBuffer.hpp:427
bool is_initialized() const
Check whether Vulkan handles are present (buffer registered)
Definition VKBuffer.hpp:230
bool is_host_visible() const
Whether this VKBuffer should be host-visible.
Definition VKBuffer.hpp:278
@ 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: