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

◆ update_chain_render_range()

void MayaFlux::Buffers::NetworkGeometryBuffer::update_chain_render_range ( size_t  index,
uint32_t  vertex_offset,
uint32_t  vertex_count,
const std::optional< Kakshya::VertexLayout > &  layout,
std::vector< Portal::Graphics::DrawRun >  runs = {} 
)

Update vertex range for a specific operator chain index.

Parameters
indexOperator chain index
vertex_offsetStarting vertex offset for this chain
vertex_countNumber of vertices for this chain
layoutOptional vertex layout for this chain (if different from primary)
runsThis operator's spans, in this buffer's vertex coordinates. Consumed only by a triangulating processor; empty leaves it to treat its whole range as one span.

This allows the processor to push per-chain vertex ranges to the RenderProcessor, enabling it to issue draw calls for specific subsets of the geometry.

Offsets in runs must already be rebased off this operator's slice base: GraphicsOperator::topology_runs() reports operator-local offsets, and only whoever concatenated the slices knows where each one landed.

Definition at line 253 of file NetworkGeometryBuffer.cpp.

259{
260 if (index == 0) {
261 if (m_render_processor) {
262 m_render_processor->set_vertex_range(vertex_offset, vertex_count);
263 m_render_processor->set_runs(std::move(runs));
264 }
265 return;
266 }
267
268 const size_t ci = index - 1;
269 if (ci >= m_chain_render_processors.size())
270 return;
271
272 auto& entry = m_chain_render_processors[ci];
273 entry.vertex_offset = vertex_offset;
274 entry.vertex_count = vertex_count;
275 entry.render_processor->set_vertex_range(vertex_offset, vertex_count);
276 entry.render_processor->set_runs(std::move(runs));
277
278 if (layout) {
279 auto self = std::dynamic_pointer_cast<VKBuffer>(shared_from_this());
280 entry.render_processor->set_buffer_vertex_layout(self, *layout);
281 }
282}
uint32_t index
Definition VKDevice.cpp:122
std::vector< ChainRenderEntry > m_chain_render_processors
std::shared_ptr< RenderProcessor > m_render_processor
Definition VKBuffer.hpp:654

References index, m_chain_render_processors, and MayaFlux::Buffers::VKBuffer::m_render_processor.