Add VK_EXT_host_query_reset tests for transform feedback stream queries
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 25 Mar 2019 11:01:34 +0000 (12:01 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 31 May 2019 09:34:09 +0000 (05:34 -0400)
New tests:

dEQP-VK.transform_feedback.simple.host_query_reset_*

Components: Vulkan
VK-GL-CTS issue: 1653

Change-Id: I9e4c6cc9aa57ed07d3ba68a56be4d5cbcddd4e6c

android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/transform_feedback/vktTransformFeedbackSimpleTests.cpp
external/vulkancts/mustpass/master/vk-default-no-waivers.txt
external/vulkancts/mustpass/master/vk-default.txt

index 57cdf86..97cec2d 100755 (executable)
@@ -426863,30 +426863,55 @@ dEQP-VK.transform_feedback.simple.draw_indirect_1004
 dEQP-VK.transform_feedback.simple.draw_indirect_2036
 dEQP-VK.transform_feedback.simple.backward_dependency
 dEQP-VK.transform_feedback.simple.query_0_4
+dEQP-VK.transform_feedback.simple.host_query_reset_0_4
 dEQP-VK.transform_feedback.simple.query_0_61
+dEQP-VK.transform_feedback.simple.host_query_reset_0_61
 dEQP-VK.transform_feedback.simple.query_0_127
+dEQP-VK.transform_feedback.simple.host_query_reset_0_127
 dEQP-VK.transform_feedback.simple.query_0_251
+dEQP-VK.transform_feedback.simple.host_query_reset_0_251
 dEQP-VK.transform_feedback.simple.query_0_509
+dEQP-VK.transform_feedback.simple.host_query_reset_0_509
 dEQP-VK.transform_feedback.simple.query_1_4
+dEQP-VK.transform_feedback.simple.host_query_reset_1_4
 dEQP-VK.transform_feedback.simple.query_1_61
+dEQP-VK.transform_feedback.simple.host_query_reset_1_61
 dEQP-VK.transform_feedback.simple.query_1_127
+dEQP-VK.transform_feedback.simple.host_query_reset_1_127
 dEQP-VK.transform_feedback.simple.query_1_251
+dEQP-VK.transform_feedback.simple.host_query_reset_1_251
 dEQP-VK.transform_feedback.simple.query_1_509
+dEQP-VK.transform_feedback.simple.host_query_reset_1_509
 dEQP-VK.transform_feedback.simple.query_3_4
+dEQP-VK.transform_feedback.simple.host_query_reset_3_4
 dEQP-VK.transform_feedback.simple.query_3_61
+dEQP-VK.transform_feedback.simple.host_query_reset_3_61
 dEQP-VK.transform_feedback.simple.query_3_127
+dEQP-VK.transform_feedback.simple.host_query_reset_3_127
 dEQP-VK.transform_feedback.simple.query_3_251
+dEQP-VK.transform_feedback.simple.host_query_reset_3_251
 dEQP-VK.transform_feedback.simple.query_3_509
+dEQP-VK.transform_feedback.simple.host_query_reset_3_509
 dEQP-VK.transform_feedback.simple.query_6_4
+dEQP-VK.transform_feedback.simple.host_query_reset_6_4
 dEQP-VK.transform_feedback.simple.query_6_61
+dEQP-VK.transform_feedback.simple.host_query_reset_6_61
 dEQP-VK.transform_feedback.simple.query_6_127
+dEQP-VK.transform_feedback.simple.host_query_reset_6_127
 dEQP-VK.transform_feedback.simple.query_6_251
+dEQP-VK.transform_feedback.simple.host_query_reset_6_251
 dEQP-VK.transform_feedback.simple.query_6_509
+dEQP-VK.transform_feedback.simple.host_query_reset_6_509
 dEQP-VK.transform_feedback.simple.query_14_4
+dEQP-VK.transform_feedback.simple.host_query_reset_14_4
 dEQP-VK.transform_feedback.simple.query_14_61
+dEQP-VK.transform_feedback.simple.host_query_reset_14_61
 dEQP-VK.transform_feedback.simple.query_14_127
+dEQP-VK.transform_feedback.simple.host_query_reset_14_127
 dEQP-VK.transform_feedback.simple.query_14_251
+dEQP-VK.transform_feedback.simple.host_query_reset_14_251
 dEQP-VK.transform_feedback.simple.query_14_509
+dEQP-VK.transform_feedback.simple.host_query_reset_14_509
 dEQP-VK.transform_feedback.simple.streams_1
 dEQP-VK.transform_feedback.simple.streams_3
 dEQP-VK.transform_feedback.simple.streams_6
index cbcc518..f4613ab 100644 (file)
@@ -74,6 +74,7 @@ enum TestType
        TEST_TYPE_DRAW_INDIRECT,
        TEST_TYPE_BACKWARD_DEPENDENCY,
        TEST_TYPE_QUERY,
+       TEST_TYPE_QUERY_RESET,
        TEST_TYPE_LAST
 };
 
@@ -1504,6 +1505,14 @@ TransformFeedbackQueryTestInstance::TransformFeedbackQueryTestInstance (Context&
 
        if (m_transformFeedbackProperties.transformFeedbackQueries == DE_FALSE)
                TCU_THROW(NotSupportedError, "transformFeedbackQueries feature is not supported");
+
+       if (m_parameters.testType == TEST_TYPE_QUERY_RESET)
+       {
+               // Check VK_EXT_host_query_reset is supported
+               m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+               if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
+                       throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
+       }
 }
 
 tcu::TestStatus TransformFeedbackQueryTestInstance::iterate (void)
@@ -1571,6 +1580,9 @@ tcu::TestStatus TransformFeedbackQueryTestInstance::iterate (void)
                endRenderPass(vk, *cmdBuffer);
        }
        endCommandBuffer(vk, *cmdBuffer);
+
+       if (m_parameters.testType == TEST_TYPE_QUERY_RESET)
+               vk.resetQueryPoolEXT(device, *queryPool, queryIndex, queryCountersNumber);
        submitCommandsAndWait(vk, device, queue, *cmdBuffer);
 
        {
@@ -1588,6 +1600,36 @@ tcu::TestStatus TransformFeedbackQueryTestInstance::iterate (void)
                        return tcu::TestStatus::fail("numPrimitivesNeeded=" + de::toString(*numPrimitivesNeeded) + " while expected " + de::toString(numVerticesToWrite));
        }
 
+       if (m_parameters.testType == TEST_TYPE_QUERY_RESET)
+       {
+
+               const deUint32                  queryDataSize                   (static_cast<deUint32>(3u * sizeof(deUint32)));
+               std::vector<deUint8>    queryData                               (queryDataSize, 0u);
+               deUint32*                       numPrimitivesWritten    = reinterpret_cast<deUint32*>(&queryData[0]);
+               deUint32*                       numPrimitivesNeeded             = numPrimitivesWritten + 1;
+               deUint32*                       availabilityState               = numPrimitivesNeeded + 1;
+
+               // Initialize values
+               *numPrimitivesNeeded    = 1u;
+               *numPrimitivesWritten   = 1u;
+               *availabilityState              = 1u;
+
+               vk.resetQueryPoolEXT(device, *queryPool, queryIndex, queryCountersNumber);
+
+               vk::VkResult res = vk.getQueryPoolResults(device, *queryPool, queryIndex, queryCountersNumber, queryDataSize, &queryData[0], queryDataSize, VK_QUERY_RESULT_WITH_AVAILABILITY_BIT);
+               /* From Vulkan spec:
+                       *
+                       * If VK_QUERY_RESULT_WAIT_BIT and VK_QUERY_RESULT_PARTIAL_BIT are both not set then no result values are written to pData
+                       * for queries that are in the unavailable state at the time of the call, and vkGetQueryPoolResults returns VK_NOT_READY.
+                       * However, availability state is still written to pData for those queries if VK_QUERY_RESULT_WITH_AVAILABILITY_BIT is set.
+                       */
+               if (res != vk::VK_NOT_READY || *availabilityState != 0u)
+                       return tcu::TestStatus::fail("QueryPoolResults incorrect reset");
+           if (*numPrimitivesWritten != 1u || *numPrimitivesNeeded != 1u )
+                       return tcu::TestStatus::fail("QueryPoolResults data was modified");
+
+       }
+
        return tcu::TestStatus::pass("Pass");
 }
 
@@ -1653,7 +1695,7 @@ vkt::TestInstance*        TransformFeedbackTestCase::createInstance (vkt::Context& cont
        if (m_parameters.testType == TEST_TYPE_BACKWARD_DEPENDENCY)
                return new TransformFeedbackBackwardDependencyTestInstance(context, m_parameters);
 
-       if (m_parameters.testType == TEST_TYPE_QUERY)
+       if (m_parameters.testType == TEST_TYPE_QUERY || m_parameters.testType == TEST_TYPE_QUERY_RESET)
                return new TransformFeedbackQueryTestInstance(context, m_parameters);
 
        TCU_THROW(InternalError, "Specified test type not found");
@@ -2003,7 +2045,7 @@ void TransformFeedbackTestCase::initPrograms (SourceCollections& programCollecti
                return;
        }
 
-       if (m_parameters.testType == TEST_TYPE_QUERY)
+       if (m_parameters.testType == TEST_TYPE_QUERY || m_parameters.testType == TEST_TYPE_QUERY_RESET)
        {
                // Vertex shader
                {
@@ -2121,10 +2163,12 @@ void createTransformFeedbackSimpleTests (tcu::TestCaseGroup* group)
        }
 
        {
-               const deUint32          usedStreamId[]  = { 0, 1, 3, 6, 14 };
-               const deUint32          vertexCount[]   = { 4, 61, 127, 251, 509 };
-               const TestType          testType                = TEST_TYPE_QUERY;
-               const std::string       testName                = "query";
+               const deUint32          usedStreamId[]                  = { 0, 1, 3, 6, 14 };
+               const deUint32          vertexCount[]                   = { 4, 61, 127, 251, 509 };
+               const TestType          testType                                = TEST_TYPE_QUERY;
+               const std::string       testName                                = "query";
+               const TestType          testTypeHostQueryReset  = TEST_TYPE_QUERY_RESET;
+               const std::string       testNameHostQueryReset  = "host_query_reset";
 
                for (deUint32 streamCountsNdx = 0; streamCountsNdx < DE_LENGTH_OF_ARRAY(usedStreamId); ++streamCountsNdx)
                {
@@ -2138,6 +2182,10 @@ void createTransformFeedbackSimpleTests (tcu::TestCaseGroup* group)
                                const std::string               fullTestName    = testName + "_" + de::toString(streamId) + "_" + de::toString(vertexCount[vertexCountNdx]);
 
                                group->addChild(new TransformFeedbackTestCase(group->getTestContext(), fullTestName.c_str(), "Written primitives query test", parameters));
+
+                               const std::string               fullTestNameHostQueryReset      = testNameHostQueryReset + "_" + de::toString(streamId) + "_" + de::toString(vertexCount[vertexCountNdx]);
+                               const TestParameters    parametersHostQueryReset        = { testTypeHostQueryReset, bufferSize, 0u, streamId, 0u, 0u };
+                               group->addChild(new TransformFeedbackTestCase(group->getTestContext(), fullTestNameHostQueryReset.c_str(), "Written primitives query test", parametersHostQueryReset));
                        }
                }
        }
index 167048f..ce9503e 100644 (file)
@@ -427450,30 +427450,55 @@ dEQP-VK.transform_feedback.simple.draw_indirect_1004
 dEQP-VK.transform_feedback.simple.draw_indirect_2036
 dEQP-VK.transform_feedback.simple.backward_dependency
 dEQP-VK.transform_feedback.simple.query_0_4
+dEQP-VK.transform_feedback.simple.host_query_reset_0_4
 dEQP-VK.transform_feedback.simple.query_0_61
+dEQP-VK.transform_feedback.simple.host_query_reset_0_61
 dEQP-VK.transform_feedback.simple.query_0_127
+dEQP-VK.transform_feedback.simple.host_query_reset_0_127
 dEQP-VK.transform_feedback.simple.query_0_251
+dEQP-VK.transform_feedback.simple.host_query_reset_0_251
 dEQP-VK.transform_feedback.simple.query_0_509
+dEQP-VK.transform_feedback.simple.host_query_reset_0_509
 dEQP-VK.transform_feedback.simple.query_1_4
+dEQP-VK.transform_feedback.simple.host_query_reset_1_4
 dEQP-VK.transform_feedback.simple.query_1_61
+dEQP-VK.transform_feedback.simple.host_query_reset_1_61
 dEQP-VK.transform_feedback.simple.query_1_127
+dEQP-VK.transform_feedback.simple.host_query_reset_1_127
 dEQP-VK.transform_feedback.simple.query_1_251
+dEQP-VK.transform_feedback.simple.host_query_reset_1_251
 dEQP-VK.transform_feedback.simple.query_1_509
+dEQP-VK.transform_feedback.simple.host_query_reset_1_509
 dEQP-VK.transform_feedback.simple.query_3_4
+dEQP-VK.transform_feedback.simple.host_query_reset_3_4
 dEQP-VK.transform_feedback.simple.query_3_61
+dEQP-VK.transform_feedback.simple.host_query_reset_3_61
 dEQP-VK.transform_feedback.simple.query_3_127
+dEQP-VK.transform_feedback.simple.host_query_reset_3_127
 dEQP-VK.transform_feedback.simple.query_3_251
+dEQP-VK.transform_feedback.simple.host_query_reset_3_251
 dEQP-VK.transform_feedback.simple.query_3_509
+dEQP-VK.transform_feedback.simple.host_query_reset_3_509
 dEQP-VK.transform_feedback.simple.query_6_4
+dEQP-VK.transform_feedback.simple.host_query_reset_6_4
 dEQP-VK.transform_feedback.simple.query_6_61
+dEQP-VK.transform_feedback.simple.host_query_reset_6_61
 dEQP-VK.transform_feedback.simple.query_6_127
+dEQP-VK.transform_feedback.simple.host_query_reset_6_127
 dEQP-VK.transform_feedback.simple.query_6_251
+dEQP-VK.transform_feedback.simple.host_query_reset_6_251
 dEQP-VK.transform_feedback.simple.query_6_509
+dEQP-VK.transform_feedback.simple.host_query_reset_6_509
 dEQP-VK.transform_feedback.simple.query_14_4
+dEQP-VK.transform_feedback.simple.host_query_reset_14_4
 dEQP-VK.transform_feedback.simple.query_14_61
+dEQP-VK.transform_feedback.simple.host_query_reset_14_61
 dEQP-VK.transform_feedback.simple.query_14_127
+dEQP-VK.transform_feedback.simple.host_query_reset_14_127
 dEQP-VK.transform_feedback.simple.query_14_251
+dEQP-VK.transform_feedback.simple.host_query_reset_14_251
 dEQP-VK.transform_feedback.simple.query_14_509
+dEQP-VK.transform_feedback.simple.host_query_reset_14_509
 dEQP-VK.transform_feedback.simple.streams_1
 dEQP-VK.transform_feedback.simple.streams_3
 dEQP-VK.transform_feedback.simple.streams_6
index 8908ac9..11011e8 100644 (file)
@@ -427297,30 +427297,55 @@ dEQP-VK.transform_feedback.simple.draw_indirect_1004
 dEQP-VK.transform_feedback.simple.draw_indirect_2036
 dEQP-VK.transform_feedback.simple.backward_dependency
 dEQP-VK.transform_feedback.simple.query_0_4
+dEQP-VK.transform_feedback.simple.host_query_reset_0_4
 dEQP-VK.transform_feedback.simple.query_0_61
+dEQP-VK.transform_feedback.simple.host_query_reset_0_61
 dEQP-VK.transform_feedback.simple.query_0_127
+dEQP-VK.transform_feedback.simple.host_query_reset_0_127
 dEQP-VK.transform_feedback.simple.query_0_251
+dEQP-VK.transform_feedback.simple.host_query_reset_0_251
 dEQP-VK.transform_feedback.simple.query_0_509
+dEQP-VK.transform_feedback.simple.host_query_reset_0_509
 dEQP-VK.transform_feedback.simple.query_1_4
+dEQP-VK.transform_feedback.simple.host_query_reset_1_4
 dEQP-VK.transform_feedback.simple.query_1_61
+dEQP-VK.transform_feedback.simple.host_query_reset_1_61
 dEQP-VK.transform_feedback.simple.query_1_127
+dEQP-VK.transform_feedback.simple.host_query_reset_1_127
 dEQP-VK.transform_feedback.simple.query_1_251
+dEQP-VK.transform_feedback.simple.host_query_reset_1_251
 dEQP-VK.transform_feedback.simple.query_1_509
+dEQP-VK.transform_feedback.simple.host_query_reset_1_509
 dEQP-VK.transform_feedback.simple.query_3_4
+dEQP-VK.transform_feedback.simple.host_query_reset_3_4
 dEQP-VK.transform_feedback.simple.query_3_61
+dEQP-VK.transform_feedback.simple.host_query_reset_3_61
 dEQP-VK.transform_feedback.simple.query_3_127
+dEQP-VK.transform_feedback.simple.host_query_reset_3_127
 dEQP-VK.transform_feedback.simple.query_3_251
+dEQP-VK.transform_feedback.simple.host_query_reset_3_251
 dEQP-VK.transform_feedback.simple.query_3_509
+dEQP-VK.transform_feedback.simple.host_query_reset_3_509
 dEQP-VK.transform_feedback.simple.query_6_4
+dEQP-VK.transform_feedback.simple.host_query_reset_6_4
 dEQP-VK.transform_feedback.simple.query_6_61
+dEQP-VK.transform_feedback.simple.host_query_reset_6_61
 dEQP-VK.transform_feedback.simple.query_6_127
+dEQP-VK.transform_feedback.simple.host_query_reset_6_127
 dEQP-VK.transform_feedback.simple.query_6_251
+dEQP-VK.transform_feedback.simple.host_query_reset_6_251
 dEQP-VK.transform_feedback.simple.query_6_509
+dEQP-VK.transform_feedback.simple.host_query_reset_6_509
 dEQP-VK.transform_feedback.simple.query_14_4
+dEQP-VK.transform_feedback.simple.host_query_reset_14_4
 dEQP-VK.transform_feedback.simple.query_14_61
+dEQP-VK.transform_feedback.simple.host_query_reset_14_61
 dEQP-VK.transform_feedback.simple.query_14_127
+dEQP-VK.transform_feedback.simple.host_query_reset_14_127
 dEQP-VK.transform_feedback.simple.query_14_251
+dEQP-VK.transform_feedback.simple.host_query_reset_14_251
 dEQP-VK.transform_feedback.simple.query_14_509
+dEQP-VK.transform_feedback.simple.host_query_reset_14_509
 dEQP-VK.transform_feedback.simple.streams_1
 dEQP-VK.transform_feedback.simple.streams_3
 dEQP-VK.transform_feedback.simple.streams_6