RT descriptors
This commit is contained in:
parent
7b24f52764
commit
e4e7c66808
9 changed files with 160 additions and 59 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue