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

◆ set_buffer_vertex_layout()

void MayaFlux::Buffers::RenderProcessor::set_buffer_vertex_layout ( const std::shared_ptr< VKBuffer > &  buffer,
const Kakshya::VertexLayout &  layout 
)

Override the vertex layout used when building the pipeline for buffer.

Parameters
bufferTarget buffer (key into m_buffer_info)
layoutLayout specific to this processor's topology

Called by CompositeGeometryBuffer to give each RenderProcessor its own topology-specific layout rather than the shared aggregate on the VKBuffer. Triggers a pipeline rebuild on the next execute_shader() call.

Definition at line 553 of file RenderProcessor.cpp.

556{
557 const bool known = m_buffer_info.contains(buffer);
558 auto& state = m_buffer_info[buffer];
559
560 const bool same_input = state.semantic_layout.stride_bytes == layout.stride_bytes
561 && std::ranges::equal(state.semantic_layout.attributes, layout.attributes,
562 [](const auto& a, const auto& b) {
563 return a.component_modality == b.component_modality
564 && a.offset_in_vertex == b.offset_in_vertex;
565 });
566 const bool changed = !known || state.use_reflection || !same_input;
567
568 state.semantic_layout = layout;
569 state.use_reflection = false;
570
571 if (changed) {
573 }
574}
std::shared_ptr< NetworkGeometryBuffer > buffer
size_t a
size_t b
std::unordered_map< std::shared_ptr< VKBuffer >, BufferState > m_buffer_info

References a, MayaFlux::Kakshya::VertexLayout::attributes, b, buffer, and MayaFlux::Kakshya::VertexLayout::stride_bytes.