VK_KHR_maintenance3: Fix per-stage descriptor limit checks
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 6 Oct 2017 02:21:30 +0000 (19:21 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 6 Oct 2017 21:24:01 +0000 (17:24 -0400)
It wasn't actually checking the storage image limit (there were two
copies of the storage buffer check instead) nor was it checking the
input attachment limit.

VK-GL-CTS issue: 750

Component: Vulkan

Affects:
dEQP-VK.api.maintenance3_check.descriptor_set

Change-Id: I44cc388d0b20d4c1886db0d283c2b92712c54dc9

external/vulkancts/modules/vulkan/api/vktApiMaintenance3Check.cpp

index 4d67f11..32ea4dc 100644 (file)
@@ -222,6 +222,7 @@ private:
                deUint32                                                        maxPerStageDescriptorStorageBuffers             = 0u;
                deUint32                                                        maxPerStageDescriptorSampledImages              = 0u;
                deUint32                                                        maxPerStageDescriptorStorageImages              = 0u;
+               deUint32                                                        maxPerStageDescriptorInputAttachments   = 0u;
 
                for(deUint32 ndx = curNdx; ndx < curNdx + size; ++ndx)
                {
@@ -245,6 +246,9 @@ private:
                        if ((descriptorSetLayoutBinding[ndx].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) ||
                                        (descriptorSetLayoutBinding[ndx].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER))
                                maxPerStageDescriptorStorageImages += descriptorSetLayoutBinding->descriptorCount;
+
+                       if (descriptorSetLayoutBinding[ndx].descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)
+                               maxPerStageDescriptorInputAttachments += descriptorSetLayoutBinding->descriptorCount;
                }
 
                if (prop1.limits.maxPerStageDescriptorSamplers < maxPerStageDescriptorSamplers)
@@ -255,7 +259,9 @@ private:
                        return false;
                if (prop1.limits.maxPerStageDescriptorSampledImages < maxPerStageDescriptorSampledImages)
                        return false;
-               if (prop1.limits.maxPerStageDescriptorStorageBuffers < maxPerStageDescriptorStorageBuffers)
+               if (prop1.limits.maxPerStageDescriptorStorageImages < maxPerStageDescriptorStorageImages)
+                       return false;
+               if (prop1.limits.maxPerStageDescriptorInputAttachments < maxPerStageDescriptorInputAttachments)
                        return false;
 
                return true;