SpiecsEngine
 
Loading...
Searching...
No Matches

◆ BuildBindLessTextureDescriptorSet()

void Spices::VulkanDescriptorSet::BuildBindLessTextureDescriptorSet ( const std::string & creatorName)

Build this bind less.

Parameters
[in]creatorNameThe object this descriptor set belongs to.

Build DescriptorSetLayout.

Instance a VkDescriptorSetVariableDescriptorCountAllocateInfo.

Instance a VkDescriptorSetAllocateInfo.

Allocate DescriptorSet.

Build DescriptorSetLayout.

Instance a VkDescriptorSetVariableDescriptorCountAllocateInfo.

Instance a VkDescriptorSetAllocateInfo.

Allocate DescriptorSet.

Definition at line 272 of file VulkanDescriptor.cpp.

273 {
275
280
284 constexpr uint32_t maxBinding = SpicesShader::BINDLESS_TEXTURE_MAXNUM;
285 VkDescriptorSetVariableDescriptorCountAllocateInfo countInfo{};
286 countInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO;
287 countInfo.descriptorSetCount = 1;
288 countInfo.pDescriptorCounts = &maxBinding;
289
293 VkDescriptorSetAllocateInfo allocInfo{};
294 allocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
295 allocInfo.descriptorPool = m_Pool->GetPool();
296 allocInfo.pSetLayouts = &m_Layout.Get();
297 allocInfo.descriptorSetCount = 1;
298 allocInfo.pNext = &countInfo;
299
303 VK_CHECK(vkAllocateDescriptorSets(m_VulkanState.m_Device, &allocInfo, &m_DescriptorSet))
304 DEBUGUTILS_SETOBJECTNAME(VK_OBJECT_TYPE_DESCRIPTOR_SET, reinterpret_cast<uint64_t>(m_DescriptorSet), m_VulkanState.m_Device, "DescriptorSet" + creatorName)
305 }
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
Definition VulkanUtils.h:68
void BuildBindLessTextureDescriptorSetLayout(const std::unordered_map< uint32_t, VkDescriptorSetLayoutBinding > &bindings, const std::string &caption="")
Build a bindLess texture VkDescriptorSetLayout with bindings.
VkDescriptorSetLayout & Get()
Get a VkDescriptorSetLayout.
VulkanDescriptorSetLayout m_Layout
The VulkanDescriptorSetLayout this descriptor set in use.
std::unordered_map< uint32_t, VkDescriptorSetLayoutBinding > m_Bindings
The bindings this descriptor set in use.
std::shared_ptr< VulkanDescriptorPool > m_Pool
The VulkanDescriptorPool this descriptor set in use.
VkDescriptorSet m_DescriptorSet
The VkDescriptorSet this class handled.
VulkanState & m_VulkanState
The global VulkanState Referenced from VulkanRenderBackend.