Check descriptor indexing test doesn't overflow physical device limits

This commit is contained in:
baldurk
2019-05-27 13:23:29 +01:00
parent 789abdf130
commit 877802bef2
@@ -225,6 +225,20 @@ void main()
VulkanGraphicsTest::Prepare(argc, argv);
if(!Avail.empty())
return;
VkPhysicalDeviceProperties props;
vkGetPhysicalDeviceProperties(phys, &props);
// lazy - we could reduce this limit to a couple by not using combined image samplers
if(props.limits.maxDescriptorSetSamplers < DESC_ARRAY1_SIZE + DESC_ARRAY2_SIZE)
Avail = "maxDescriptorSetSamplers " + std::to_string(props.limits.maxDescriptorSetSamplers) +
" is insufficient";
else if(props.limits.maxDescriptorSetSampledImages < DESC_ARRAY1_SIZE + DESC_ARRAY2_SIZE)
Avail = "maxDescriptorSetSampledImages " +
std::to_string(props.limits.maxDescriptorSetSampledImages) + " is insufficient";
if(!Avail.empty())
return;