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

◆ resolve_ds_index()

std::optional< uint32_t > MayaFlux::Buffers::ShaderProcessor::resolve_ds_index ( uint32_t  set) const
protected

Resolve logical descriptor set index to actual index.

Parameters
setLogical set index from ShaderBinding
Returns
Resolved set index, or std::nullopt if invalid

Handles cases where the engine reserves set 0 for global resources. If m_engine_owns_set_zero is true, logical set 0 maps to no descriptor, and logical sets are offset by +1 in the actual descriptor sets.

Definition at line 751 of file ShaderProcessor.cpp.

752{
754 if (set == 0)
755 return std::nullopt;
756 const uint32_t idx = set - 1;
757 if (idx >= m_descriptor_set_ids.size())
758 return std::nullopt;
759 return idx;
760 }
761 if (set >= m_descriptor_set_ids.size())
762 return std::nullopt;
763 return set;
764}
bool m_engine_owns_set_zero
Whether the engine reserves set=0 for global resources.
std::vector< Portal::Graphics::DescriptorSetID > m_descriptor_set_ids

References m_descriptor_set_ids, and m_engine_owns_set_zero.

Referenced by MayaFlux::Buffers::RenderProcessor::bind_texture(), and update_descriptors().

+ Here is the caller graph for this function: