Fix output components limit in fragment input tests
authorGraeme Leese <gleese@broadcom.com>
Thu, 3 Jun 2021 15:44:05 +0000 (16:44 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 29 Jun 2021 07:08:17 +0000 (07:08 +0000)
The number of outputs components is 4 higher than the number of fragment
inputs because gl_Position needs to be counted as well.

Component: Vulkan
Affects: dEQP-VK.glsl.limits.near_max.fragment_input.*

Change-Id: Ic1cd888c04c8877312af104f5bcd3afc607480f8

external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderLimitTests.cpp

index e4cbfb5..fdca739 100644 (file)
@@ -234,10 +234,11 @@ TestInstance* FragmentInputComponentCase::createInstance (Context& context) cons
                TCU_THROW(NotSupportedError, notSupportedStr.c_str());
        }
 
-       if (m_inputComponents > maxVertexOutputComponents)
+       // gl_Position counts as an output component as well, so outputComponents = inputComponents + 4
+       if (m_inputComponents + 4 > maxVertexOutputComponents)
        {
                const std::string notSupportedStr = "Unsupported number of user specified vertex output components (" +
-                                                                                       de::toString(m_inputComponents) +
+                                                                                       de::toString(m_inputComponents + 4) +
                                                                                        ") maxVertexOutputComponents=" + de::toString(maxVertexOutputComponents);
                TCU_THROW(NotSupportedError, notSupportedStr.c_str());
        }