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

◆ read_back_buffer()

void MayaFlux::Buffers::DataReadProcessor::read_back_buffer ( size_t  index,
size_t  byte_count 
)

Read a raw back_buffers slot of the attached buffer.

Parameters
indexSlot index into its back_buffers.
byte_countBytes to read. A slot does not carry its size, so this must not exceed what the buffer's owner allocated for it.

Definition at line 110 of file DataReadProcessor.cpp.

111{
112 arm([index, byte_count](DataReadProcessor& self, const std::shared_ptr<VKBuffer>& vk, PendingRead& pending) {
113 const auto& slots = vk->get_buffer_resources().back_buffers;
114 if (index >= slots.size() || byte_count == 0) {
115 MF_RT_ERROR(Journal::Component::Buffers, Journal::Context::BufferProcessing,
116 "DataReadProcessor read_back_buffer needs an existing slot and a nonzero byte count");
117 return false;
118 }
119 pending.handle = gpu_buffer_handle(slots[index], byte_count);
120 return submit_read(pending, self.m_staging, byte_count, byte_count, true, true);
121 });
122}
uint32_t index
Definition VKDevice.cpp:122
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.

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

+ Here is the call graph for this function: