Remove max expected query result in pipeline statistics tests
authorMaciej Jesionowski <maciej.jesionowski@amd.com>
Wed, 29 Nov 2017 13:07:42 +0000 (14:07 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 11 Dec 2017 14:30:16 +0000 (09:30 -0500)
Query result is implementation-defined and some internal rendering
operations may count towards the results of queries.

Affects: dEQP-VK.query_pool.statistics_query.*

Components: Vulkan

VK-GL-CTS issue: 876

Change-Id: I0c86e1101c1ae00049623bd49dfe0c4de5798832

external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp

index f5ea979..7802f74 100644 (file)
@@ -1055,12 +1055,11 @@ tcu::TestStatus VertexShaderTestInstance::checkResult (VkQueryPool queryPool)
        const VkDevice                  device          = m_context.getDevice();
        deUint64                                result          = 0u;
        deUint64                                expectedMin     = 0u;
-       deUint64                                expectedMax     = 0u;
+
        switch(m_parametersGraphic.queryStatisticFlags)
        {
                case VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT:
                        expectedMin = 16u;
-                       expectedMax = expectedMin + 3u;
                        break;
                case VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT:
                        expectedMin =   m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST                                    ? 15u :
@@ -1069,7 +1068,6 @@ tcu::TestStatus VertexShaderTestInstance::checkResult (VkQueryPool queryPool)
                                                        m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY             ?  6u :
                                                        m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY    ?  8u :
                                                        16u;
-                       expectedMax =   m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY             ? 12u : 19u;
                        break;
                case VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT:
                        expectedMin =   m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST                                               ? 16u :
@@ -1083,7 +1081,6 @@ tcu::TestStatus VertexShaderTestInstance::checkResult (VkQueryPool queryPool)
                                                        m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY             ?  2u :
                                                        m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY    ?  6u :
                                                        0u;
-                       expectedMax = expectedMin + 3u;
                        break;
                case VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT:
                        expectedMin =   m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST                                               ?     9u :
@@ -1097,7 +1094,6 @@ tcu::TestStatus VertexShaderTestInstance::checkResult (VkQueryPool queryPool)
                                                        m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY             ?   992u :
                                                        m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY    ?  3072u :
                                                        0u;
-                       expectedMax = 4u * expectedMin;
                        break;
                default:
                        DE_ASSERT(0);
@@ -1105,7 +1101,7 @@ tcu::TestStatus VertexShaderTestInstance::checkResult (VkQueryPool queryPool)
        }
 
        VK_CHECK(vk.getQueryPoolResults(device, queryPool, 0u, 1u, sizeof(deUint64), &result, 0u, VK_QUERY_RESULT_64_BIT));
-       if (result < expectedMin || result > expectedMax)
+       if (result < expectedMin)
                return tcu::TestStatus::fail("QueryPoolResults incorrect");
 
        if (m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP && !checkImage())
@@ -1446,7 +1442,6 @@ tcu::TestStatus GeometryShaderTestInstance::checkResult (VkQueryPool queryPool)
        const VkDevice                  device          = m_context.getDevice();
        deUint64                                result          = 0u;
        deUint64                                expectedMin     = 0u;
-       deUint64                                expectedMax     = 0u;
 
        switch(m_parametersGraphic.queryStatisticFlags)
        {
@@ -1483,10 +1478,8 @@ tcu::TestStatus GeometryShaderTestInstance::checkResult (VkQueryPool queryPool)
                break;
        }
 
-       expectedMax = expectedMin + 1;
-
        VK_CHECK(vk.getQueryPoolResults(device, queryPool, 0u, 1u, sizeof(deUint64), &result, 0u, VK_QUERY_RESULT_64_BIT));
-       if (result < expectedMin || result > expectedMax)
+       if (result < expectedMin)
                return tcu::TestStatus::fail("QueryPoolResults incorrect");
 
        if ( (m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST || m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP ) && !checkImage())
@@ -1815,23 +1808,21 @@ tcu::TestStatus TessellationShaderTestInstance::checkResult (VkQueryPool queryPo
        const VkDevice                  device          = m_context.getDevice();
        deUint64                                result          = 0u;
        deUint64                                expectedMin     = 0u;
-       deUint64                                expectedMax     = 0u;
+
        switch(m_parametersGraphic.queryStatisticFlags)
        {
                case VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT:
                        expectedMin = 4u;
-                       expectedMax = expectedMin * 4u;
                        break;
                case VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT:
                        expectedMin = 100u;
-                       expectedMax = expectedMin * 4u;
                        break;
                default:
                        DE_ASSERT(0);
                        break;
        }
        VK_CHECK(vk.getQueryPoolResults(device, queryPool, 0u, 1u, sizeof(deUint64), &result, 0u, VK_QUERY_RESULT_64_BIT));
-       if (result < expectedMin || result > expectedMax)
+       if (result < expectedMin)
                return tcu::TestStatus::fail("QueryPoolResults incorrect");
 
        if (!checkImage())