MayaFlux 0.4.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 353 of file ShaderProcessor.cpp.

354{
356 if (set == 0)
357 return std::nullopt;
358 const uint32_t idx = set - 1;
359 if (idx >= m_descriptor_set_ids.size())
360 return std::nullopt;
361 return idx;
362 }
363 if (set >= m_descriptor_set_ids.size())
364 return std::nullopt;
365 return set;
366}
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: