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

◆ read_buffer()

void MayaFlux::Buffers::DataReadProcessor::read_buffer ( std::shared_ptr< VKBuffer >  source,
size_t  byte_count = 0 
)

Read another VKBuffer, such as a descriptor-bound or instance buffer.

Parameters
sourceBuffer to read; retained until the request runs.
byte_countBytes to read, or zero for its full allocation, which may exceed the bytes its owner currently fills.

Definition at line 68 of file DataReadProcessor.cpp.

69{
70 arm([source = std::move(source), byte_count](DataReadProcessor& self, const std::shared_ptr<VKBuffer>&, PendingRead& pending) {
71 if (!source || !source->is_initialized()) {
72 MF_RT_ERROR(Journal::Component::Buffers, Journal::Context::BufferProcessing,
73 "DataReadProcessor read_buffer requires an initialized source buffer");
74 return false;
75 }
76 pending.source = source;
77 pending.handle = gpu_buffer_handle(source);
78 return submit_read(pending, self.m_staging, source->get_size_bytes(), byte_count,
79 source->is_host_visible(), is_transfer_source(source));
80 });
81}
static bool submit_read(PendingRead &pending, std::shared_ptr< VKBuffer > &staging, size_t available_bytes, size_t byte_count, bool mapped, bool transferable)
Portal::Graphics::GpuBufferHandle gpu_buffer_handle(const std::shared_ptr< VKBuffer > &buffer)
View a buffer's primary GPU storage without reading it back.
bool is_transfer_source(const std::shared_ptr< VKBuffer > &buffer)
Whether a buffer's memory can be the source of a transfer.
Source source()
Begin a Source chain.
Definition Plot.hpp:127

References arm(), MayaFlux::Buffers::gpu_buffer_handle(), MayaFlux::Buffers::DataReadProcessor::PendingRead::handle, MayaFlux::Buffers::is_transfer_source(), m_staging, MayaFlux::Buffers::DataReadProcessor::PendingRead::source, and submit_read().

+ Here is the call graph for this function: