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

Function is_depth_a_dependency

framework/core/render_pass.cpp:252–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250 */
251template <typename T_SubpassDescription, typename T_AttachmentDescription>
252bool is_depth_a_dependency(std::vector<T_SubpassDescription> &subpass_descriptions, std::vector<T_AttachmentDescription> &attachment_descriptions)
253{
254 // More than 1 subpass uses depth
255 if (std::ranges::count_if(subpass_descriptions,
256 [](auto const &subpass) {
257 return subpass.pDepthStencilAttachment != nullptr;
258 }) > 1)
259 {
260 return true;
261 }
262
263 // Otherwise check if any uses depth as an input
264 return std::ranges::any_of(
265 subpass_descriptions,
266 [&attachment_descriptions](auto const &subpass) {
267 return std::ranges::any_of(
268 std::span{subpass.pInputAttachments, subpass.inputAttachmentCount},
269 [&attachment_descriptions](auto const &reference) {
270 return vkb::is_depth_format(attachment_descriptions[reference.attachment].format);
271 });
272 });
273
274 return false;
275}
276
277template <typename T>
278std::vector<T> get_subpass_dependencies(const size_t subpass_count, bool depth_stencil_dependency)

Callers 1

create_renderpassMethod · 0.85

Calls 1

is_depth_formatFunction · 0.50

Tested by

no test coverage detected