MayaFlux 0.5.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 384 of file ShaderProcessor.cpp.

385{
387 if (set == 0)
388 return std::nullopt;
389 const uint32_t idx = set - 1;
390 if (idx >= m_descriptor_set_ids.size())
391 return std::nullopt;
392 return idx;
393 }
394 if (set >= m_descriptor_set_ids.size())
395 return std::nullopt;
396 return set;
397}
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(), MayaFlux::Buffers::RenderProcessor::execute_shader(), MayaFlux::Buffers::RenderProcessor::initialize_descriptors(), and update_descriptors().

+ Here is the caller graph for this function: