| 250 | */ |
| 251 | template <typename T_SubpassDescription, typename T_AttachmentDescription> |
| 252 | bool 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 | |
| 277 | template <typename T> |
| 278 | std::vector<T> get_subpass_dependencies(const size_t subpass_count, bool depth_stencil_dependency) |
no test coverage detected