Skip to content

Commit

Permalink
WIP: fix CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe2933 committed Sep 1, 2024
1 parent 64ab9b7 commit 5a71d09
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions interface/descriptors/DescriptorSet.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ module;

#ifndef VKU_USE_STD_MODULE
#include <cstdint>
#include <array>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
#ifdef _MSC_VER
#include <compare>
#endif
Expand All @@ -18,9 +20,12 @@ export module vku:descriptors.DescriptorSet;
import std;
#endif
export import :descriptors.DescriptorSetLayout;
import :details;
import :details.concepts;
import :details.functional;
import :utils;

#define INDEX_SEQ(Is, N, ...) [&]<std::size_t ...Is>(std::index_sequence<Is...>) __VA_ARGS__ (std::make_index_sequence<N>{})

template <VULKAN_HPP_NAMESPACE::DescriptorType> struct WriteDescriptorInfo;
template <> struct WriteDescriptorInfo<VULKAN_HPP_NAMESPACE::DescriptorType::eSampler> { using type = VULKAN_HPP_NAMESPACE::DescriptorImageInfo; };
template <> struct WriteDescriptorInfo<VULKAN_HPP_NAMESPACE::DescriptorType::eCombinedImageSampler> { using type = VULKAN_HPP_NAMESPACE::DescriptorImageInfo; };
Expand Down Expand Up @@ -114,10 +119,12 @@ namespace vku {
VULKAN_HPP_NAMESPACE::DescriptorPool pool,
const std::tuple<Layouts...> &layouts
) -> std::tuple<DescriptorSet<std::remove_cvref_t<Layouts>>...> {
return std::apply([&](const auto &...layout) {
return std::apply([&](auto... rawSet) {
return std::tuple { DescriptorSet<std::remove_cvref_t<Layouts>> { rawSet }... };
}, device.allocateDescriptorSets({ pool, unsafeProxy({ *layout... }) }) | ranges::to_array<sizeof...(Layouts)>());
const std::array rawDescriptorSetLayouts = std::apply([&](const auto &...layout) {
return std::array { *layout... };
}, layouts);
const std::vector rawDescriptorSets = device.allocateDescriptorSets({ pool, rawDescriptorSetLayouts });
return INDEX_SEQ(Is, sizeof...(Layouts), {
return std::tuple { DescriptorSet<std::remove_cvref_t<Layouts>> { rawDescriptorSets[Is] }... };
});
}
}

0 comments on commit 5a71d09

Please sign in to comment.