Skip to content

Commit

Permalink
Allow allocating dynamic uniform buffer descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
rys committed Feb 1, 2021
1 parent b3a4f62 commit 5f1bc5f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/VK/base/ResourceViewHeaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ namespace CAULDRON_VK
m_pDevice = pDevice;
m_allocatedDescriptorCount = 0;

std::vector<VkDescriptorPoolSize> type_count =
const VkDescriptorPoolSize type_count[] =
{
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, cbvDescriptorCount },
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, cbvDescriptorCount },
{ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, srvDescriptorCount },
{ VK_DESCRIPTOR_TYPE_SAMPLER, samplerDescriptorCount },
Expand All @@ -41,8 +42,8 @@ namespace CAULDRON_VK
descriptor_pool.pNext = NULL;
descriptor_pool.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
descriptor_pool.maxSets = 8000;
descriptor_pool.poolSizeCount = (uint32_t)type_count.size();
descriptor_pool.pPoolSizes = type_count.data();
descriptor_pool.poolSizeCount = _countof( type_count );
descriptor_pool.pPoolSizes = type_count;

VkResult res = vkCreateDescriptorPool(pDevice->GetDevice(), &descriptor_pool, NULL, &m_descriptorPool);
assert(res == VK_SUCCESS);
Expand Down

0 comments on commit 5f1bc5f

Please sign in to comment.