43 constexpr Binding(uint32_t binding,
44 VkDescriptorType type,
45 VkShaderStageFlags stageFlags,
46 uint32_t descriptorCount = 1,
47 VkDescriptorBindingFlagsEXT bindingFlags = 0) :
49 g_descriptorType(type),
50 g_descriptorCount(descriptorCount),
51 g_stageFlags(stageFlags),
52 g_bindingFlags(bindingFlags)
55 constexpr void setBinding(uint32_t binding) { this->g_binding = binding; }
56 [[nodiscard]]
constexpr uint32_t getBinding()
const {
return this->g_binding; }
58 constexpr void setDescriptorType(VkDescriptorType type) { this->g_descriptorType = type; }
59 [[nodiscard]]
constexpr VkDescriptorType getDescriptorType()
const {
return this->g_descriptorType; }
61 constexpr void setDescriptorCount(uint32_t descriptorCount) { this->g_descriptorCount = descriptorCount; }
62 [[nodiscard]]
constexpr uint32_t getDescriptorCount()
const {
return this->g_descriptorCount; }
64 constexpr void setStageFlags(VkShaderStageFlags stageFlags) { this->g_stageFlags = stageFlags; }
65 [[nodiscard]]
constexpr VkShaderStageFlags getStageFlags()
const {
return this->g_stageFlags; }
67 constexpr void setBindingFlags(VkDescriptorBindingFlagsEXT bindingFlags)
69 this->g_bindingFlags = bindingFlags;
71 constexpr void clearBindingFlags() { this->g_bindingFlags = 0; }
72 [[nodiscard]]
constexpr VkDescriptorBindingFlagsEXT getBindingFlags()
const {
return this->g_bindingFlags; }
74 constexpr explicit operator VkDescriptorSetLayoutBinding()
const
76 return {.binding = this->g_binding,
77 .descriptorType = this->g_descriptorType,
78 .descriptorCount = this->g_descriptorCount,
79 .stageFlags = this->g_stageFlags,
80 .pImmutableSamplers =
nullptr};
85 VkDescriptorType g_descriptorType;
86 uint32_t g_descriptorCount;
87 VkShaderStageFlags g_stageFlags;
88 VkDescriptorBindingFlagsEXT g_bindingFlags;