Skip to content

Commit

Permalink
Check maxPerStageDescriptor instead of maxDescriptorSet
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejnau committed Jan 12, 2024
1 parent 97884be commit ff46451
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/FlyCube/Device/VKDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,22 +848,20 @@ uint32_t VKDevice::GetMaxDescriptorSetBindings(vk::DescriptorType type) const
{
switch (type) {
case vk::DescriptorType::eSampler:
return m_device_properties.limits.maxDescriptorSetSamplers;
return m_device_properties.limits.maxPerStageDescriptorSamplers;
case vk::DescriptorType::eCombinedImageSampler:
case vk::DescriptorType::eSampledImage:
case vk::DescriptorType::eUniformTexelBuffer:
return m_device_properties.limits.maxDescriptorSetSampledImages;
return m_device_properties.limits.maxPerStageDescriptorSampledImages;
case vk::DescriptorType::eUniformBuffer:
return m_device_properties.limits.maxDescriptorSetUniformBuffers;
case vk::DescriptorType::eUniformBufferDynamic:
return m_device_properties.limits.maxDescriptorSetUniformBuffersDynamic;
return m_device_properties.limits.maxPerStageDescriptorUniformBuffers;
case vk::DescriptorType::eStorageBuffer:
return m_device_properties.limits.maxDescriptorSetStorageBuffers;
case vk::DescriptorType::eStorageBufferDynamic:
return m_device_properties.limits.maxDescriptorSetStorageBuffersDynamic;
return m_device_properties.limits.maxPerStageDescriptorStorageBuffers;
case vk::DescriptorType::eStorageImage:
case vk::DescriptorType::eStorageTexelBuffer:
return m_device_properties.limits.maxDescriptorSetStorageImages;
return m_device_properties.limits.maxPerStageDescriptorStorageImages;
default:
assert(false);
return 0;
Expand Down

0 comments on commit ff46451

Please sign in to comment.