MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / get_struct_impl

Method get_struct_impl

framework/structure_chain_builder.h:124–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122template <vkb::BindingType bindingType, typename AnchorStructType>
123template <typename StructType>
124inline StructType const *StructureChainBuilder<bindingType, AnchorStructType>::get_struct_impl(size_t skip) const
125{
126 assert(!skip || StructType::allowDuplicate); // If skip is non-zero, the struct type must allow duplicates in the structure chain
127
128 auto it = std::ranges::find_if(structure_chain, [](auto const &chain_element) {
129 return std::any_cast<StructType>(chain_element.get()) != nullptr;
130 });
131 for (size_t i = 0; (i < skip) && (it != structure_chain.end()); ++i)
132 {
133 it = std::find_if(std::next(it), structure_chain.end(), [](auto const &chain_element) {
134 return std::any_cast<StructType>(chain_element.get()) != nullptr;
135 });
136 }
137 return (it != structure_chain.end()) ? std::any_cast<StructType>(it->get()) : nullptr;
138}
139
140template <vkb::BindingType bindingType, typename AnchorStructType>
141inline void StructureChainBuilder<bindingType, AnchorStructType>::set_anchor_struct(AnchorStructType const &anchor_struct)

Callers

nothing calls this directly

Calls 2

endMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected