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

◆ get_data()

std::vector< Kakshya::DataVariant > MayaFlux::Buffers::VKBuffer::get_data ( )

Read buffer contents as Kakshya DataVariant.

For host-visible buffers this returns a single DataVariant containing the raw bytes. For device-local buffers this warns and returns empty — a BufferDownloadProcessor should be used to read GPU-only memory.

Returns
Vector of DataVariant objects representing buffer contents.

Definition at line 96 of file VKBuffer.cpp.

97{
98 if (!is_initialized()) {
100 "Cannot get_data from uninitialized VKBuffer");
101 return {};
102 }
103
106
107 std::vector<uint8_t> raw_bytes(m_size_bytes);
108 std::memcpy(raw_bytes.data(), m_resources.mapped_ptr, m_size_bytes);
109 return { raw_bytes };
110 }
111
113 "get_data() on device-local buffer requires BufferDownloadProcessor");
114 return {};
115}
#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
void mark_invalid_range(size_t offset, size_t size)
Mark a range as invalid (needs download)
Definition VKBuffer.cpp:351
@ 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, mark_invalid_range(), and MF_WARN.

Referenced by clone_to().

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