Check viewport limits against framebuffer limits
authorGraeme Leese <gleese@broadcom.com>
Mon, 18 Sep 2017 23:58:22 +0000 (00:58 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 26 Sep 2017 11:13:40 +0000 (07:13 -0400)
They were being checked against the maximum image dimensions which was
incorrect.

Affects: dEQP-VK.api.info.device.properties
Components: Vulkan
VK-GL-CTS Issue: 700

Change-Id: Ia11bb69439294c5160d2da0a432ef8fc38e33500

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

index af8c011..5c977e1 100644 (file)
@@ -462,14 +462,14 @@ bool validateFeatureLimits(VkPhysicalDeviceProperties* properties, VkPhysicalDev
                }
        }
 
-       for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(limits->maxViewportDimensions); ndx++)
+       if (limits->maxFramebufferWidth > limits->maxViewportDimensions[0] ||
+           limits->maxFramebufferHeight > limits->maxViewportDimensions[1])
        {
-               if (limits->maxImageDimension2D > limits->maxViewportDimensions[ndx])
-               {
-                       log << TestLog::Message << "limit validation failed, maxImageDimension2D of " << limits->maxImageDimension2D
-                               << "is larger than maxViewportDimension[" << ndx << "] of " << limits->maxViewportDimensions[ndx] << TestLog::EndMessage;
-                       limitsOk = false;
-               }
+               log << TestLog::Message << "limit validation failed, maxFramebufferDimension of "
+                       << "[" << limits->maxFramebufferWidth << ", " << limits->maxFramebufferHeight << "] "
+                       << "is larger than maxViewportDimension of "
+                       << "[" << limits->maxViewportDimensions[0] << ", " << limits->maxViewportDimensions[1] << "]" << TestLog::EndMessage;
+               limitsOk = false;
        }
 
        if (limits->viewportBoundsRange[0] > float(-2 * limits->maxViewportDimensions[0]))