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

◆ read_vertices()

void MayaFlux::Buffers::DataReadProcessor::read_vertices ( )

Read the attached buffer's declared vertices; the layout count may represent capacity.

Definition at line 124 of file DataReadProcessor.cpp.

125{
126 arm([](DataReadProcessor& self, const std::shared_ptr<VKBuffer>& vk, PendingRead& pending) {
127 if (std::dynamic_pointer_cast<TextureBuffer>(vk)) {
129 "DataReadProcessor read_vertices does not read TextureBuffer's display quad");
130 return false;
131 }
132 if (vk->has_index_buffer()) {
134 "DataReadProcessor read_vertices cannot read an indexed buffer; use read_mesh");
135 return false;
136 }
137 pending.layout = resolve_vertex_layout(vk);
138 if (!pending.layout) {
140 "DataReadProcessor requires a valid vertex layout within the primary allocation");
141 return false;
142 }
143 pending.handle = gpu_buffer_handle(vk);
144 return submit_read(pending, self.m_staging, vk->get_size_bytes(),
145 static_cast<size_t>(pending.layout->vertex_count) * pending.layout->stride_bytes,
146 vk->is_host_visible(), is_transfer_source(vk));
147 });
148}
#define MF_RT_ERROR(comp, ctx,...)
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.
std::optional< Kakshya::VertexLayout > resolve_vertex_layout(const std::shared_ptr< VKBuffer > &source)
Resolve the vertex extent of a buffer's primary storage for reading.
bool is_transfer_source(const std::shared_ptr< VKBuffer > &buffer)
Whether a buffer's memory can be the source of a transfer.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References arm(), MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::gpu_buffer_handle(), MayaFlux::Buffers::DataReadProcessor::PendingRead::handle, MayaFlux::Buffers::is_transfer_source(), MayaFlux::Buffers::DataReadProcessor::PendingRead::layout, m_staging, MF_RT_ERROR, MayaFlux::Buffers::resolve_vertex_layout(), and submit_read().

Referenced by MayaFlux::Kriya::detail::arm_graphics_read().

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