Description
This issue is for refactoring the VkRenderPass logic for object creation. Current implementation manually assigns and indexes VkRenderPass structures. Moving towards a more robust, extensible, and modernized approach.
Using STL ranges and views in replacement for manual for-loops and STL vector indexing with std::views::transform and std::views::filter.
Pseudo-Example
Brief example of an idea to getting the STL ranges and views working with filtering between renderpass attachments (color/depth).
// getting getting our attachments
auto attachments = p_attachments
| std::views::transform([](const auto& attachment) {
return VkAttachmentDescription{
// specify that attachment here in the parameters
};
}); | std::ranges::to<std::vector>(); // represent as std::vector
// filtering between color/depth attachments
auto color_attachments = attachments
| std::views::enumerate
| std::views::filter([](const auto& pair) { return !has_depth(std::get<1>(pair).layout); })
| std::views::transform([](const auto& pair){
auto[idx, spec] = pair;
return VkAttachmentReference{
// specify parameters for attachment reference
};
}) | std::ranges::to<std::vector>();
What does task completion look like?
- API modernization consuming
span<const attachment> for setting up renderpass attachments
- Ranges used for mapping structures for filtering between color and depth attachments.
- Using
ranges::transform and views::filter to filter between renderpass specifics.
Description
This issue is for refactoring the
VkRenderPasslogic for object creation. Current implementation manually assigns and indexes VkRenderPass structures. Moving towards a more robust, extensible, and modernized approach.Using STL ranges and views in replacement for manual for-loops and STL vector indexing with
std::views::transformandstd::views::filter.Pseudo-Example
Brief example of an idea to getting the STL ranges and views working with filtering between renderpass attachments (color/depth).
What does task completion look like?
span<const attachment>for setting up renderpass attachmentsranges::transformandviews::filterto filter between renderpass specifics.