RT descriptors

This commit is contained in:
Jorijn van der Graaf 2026-01-29 01:31:17 +01:00
commit e4e7c66808
9 changed files with 160 additions and 59 deletions

View file

@ -30,17 +30,21 @@ import :DescriptorLayoutVulkan;
import Crafter.Event;
export namespace Crafter {
template <std::uint32_t PoolCount, typename... Shaders>
class DescriptorPool {
class DescriptorPoolBase {
public:
inline static Event<void> onDescriptorRefresh;
inline static std::uint32_t setIndex = 0;
inline static std::uint32_t setsCount = 0;
inline static std::vector<VkDescriptorSet> sets;
inline static VkDescriptorPool descriptorPool[PoolCount] = { VK_NULL_HANDLE };
std::vector<VkDescriptorSet> sets;
};
template <std::uint32_t PoolCount, typename... Shaders>
class DescriptorPool : public DescriptorPoolBase {
public:
Event<void> onDescriptorRefresh;
std::uint32_t setIndex = 0;
std::uint32_t setsCount = 0;
VkDescriptorPool descriptorPool[PoolCount] = { VK_NULL_HANDLE };
public:
static void BuildPool(std::uint32_t poolIndex) {
void BuildPool(std::uint32_t poolIndex) {
if(descriptorPool[poolIndex] != VK_NULL_HANDLE) {
vkDestroyDescriptorPool(VulkanDevice::device, descriptorPool[poolIndex], nullptr);
}