Unverified Commit 916063bf by jamesRumbleh Committed by GitHub

Improve DescriptorPool creation.

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.
parent 7a8021ed
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment