Skip to content

Commit

Permalink
Improve DescriptorPool creation.
Browse files Browse the repository at this point in the history
Remove the use of Physical Device limits for setting the maximum number of resource descriptor types available for the DescriptorPool used in the demo. This was incorrect usage of Vulkan.
  • Loading branch information
rumblehhh committed Aug 13, 2019
1 parent 7a8021e commit 916063b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions examples/Vulkan/PostProcessing/VulkanPostProcessing.cpp
Expand Up @@ -3778,14 +3778,11 @@ pvr::Result VulkanPostProcessing::initView()
pvrvk::CommandPoolCreateInfo(_deviceResources->queues[0]->getFamilyIndex(), pvrvk::CommandPoolCreateFlags::e_RESET_COMMAND_BUFFER_BIT));

// This demo application makes use of quite a large number of Images and Buffers and therefore we're making possible for the descriptor pool to allocate descriptors with various limits.maxDescriptorSet*
_deviceResources->descriptorPool =
_deviceResources->device->createDescriptorPool(pvrvk::DescriptorPoolCreateInfo()
.setMaxDescriptorSets(125)
.addDescriptorInfo(pvrvk::DescriptorType::e_COMBINED_IMAGE_SAMPLER,
_deviceResources->device->getPhysicalDevice()->getProperties().getLimits().getMaxDescriptorSetSampledImages())
.addDescriptorInfo(pvrvk::DescriptorType::e_STORAGE_IMAGE, 20)
.addDescriptorInfo(pvrvk::DescriptorType::e_UNIFORM_BUFFER,
_deviceResources->device->getPhysicalDevice()->getProperties().getLimits().getMaxDescriptorSetUniformBuffers()));
_deviceResources->descriptorPool = _deviceResources->device->createDescriptorPool(pvrvk::DescriptorPoolCreateInfo()
.setMaxDescriptorSets(150)
.addDescriptorInfo(pvrvk::DescriptorType::e_COMBINED_IMAGE_SAMPLER, 200)
.addDescriptorInfo(pvrvk::DescriptorType::e_STORAGE_IMAGE, 20)
.addDescriptorInfo(pvrvk::DescriptorType::e_UNIFORM_BUFFER, 200));

// create the utility commandbuffer which will be used for image layout transitions and buffer/image uploads.
_deviceResources->utilityCommandBuffer = _deviceResources->commandPool->allocateCommandBuffer();
Expand Down

0 comments on commit 916063b

Please sign in to comment.