diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp index 7eb81c6ca..8545c77d8 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp @@ -2063,7 +2063,11 @@ tcu::TestStatus VertexShaderTestInstance::executeTest(void) for (uint64_t j = 0; j < m_drawRepeats[i]; ++j) draw(*cmdBuffer); - commandClearAttachment(vk, *cmdBuffer); + // for fragment shader invocations, we can't clear in between or the query may be trivialized. + // since the clear would let the implementation skip all the fragments underneath the clear. + if (queryCount > 1) + commandClearAttachment(vk, *cmdBuffer); + vk.cmdEndQuery(*cmdBuffer, *queryPool, i); } @@ -2163,16 +2167,16 @@ tcu::TestStatus VertexShaderTestInstance::checkResult(VkQueryPool queryPool) break; case VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT: expectedMin = - m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST ? 9u : - m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST ? 192u : - m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP ? 448u : + m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST ? 4u : + m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST ? 128u : + m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP ? 312u : m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST ? 2016u : m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP ? 4096u : - m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN ? 10208u : + m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN ? 3488 : m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY ? 128u : - m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY ? 416u : + m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY ? 281u : m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY ? 992u : - m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY ? 3072u : + m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY ? 2048u : 0u; break; default: @@ -2348,7 +2352,8 @@ tcu::TestStatus VertexShaderSecondaryTestInstance::executeTest(void) vk.cmdBindVertexBuffers(secondaryCmdBuffers[i]->get(), 0u, 1u, &vertexBuffer, &vertexBufferOffset); for (uint32_t j = 0; j < m_drawRepeats[i]; ++j) draw(secondaryCmdBuffers[i]->get()); - commandClearAttachment(vk, secondaryCmdBuffers[i]->get()); + if (queryCount > 1) + commandClearAttachment(vk, secondaryCmdBuffers[i]->get()); vk.cmdEndQuery(secondaryCmdBuffers[i]->get(), *queryPool, i); endCommandBuffer(vk, secondaryCmdBuffers[i]->get()); } @@ -5248,6 +5253,7 @@ void QueryPoolStatisticsTests::init(void) "triangle_strip_with_adjacency", "patch_list"}; + std::vector oneRepeat = {1}; std::vector sixRepeats = {1, 3, 5, 8, 15, 24}; de::MovePtr computeShaderInvocationsGroup( new TestCaseGroup(m_testCtx, "compute_shader_invocations")); @@ -6157,7 +6163,7 @@ void QueryPoolStatisticsTests::init(void) GraphicBasicTestInstance::ParametersGraphic( VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_NORMAL, copyType[copyTypeIdx], query64Bits, false, dstOffset, CLEAR_NOOP, true), - sixRepeats)); + oneRepeat)); primaryHostQueryReset->addChild(new QueryPoolGraphicStatisticsTest( m_testCtx, @@ -6165,7 +6171,7 @@ void QueryPoolStatisticsTests::init(void) GraphicBasicTestInstance::ParametersGraphic( VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_NORMAL, copyType[copyTypeIdx], query64Bits, false, dstOffset, CLEAR_NOOP, true), - sixRepeats)); + oneRepeat)); primaryResetBeforeCopy->addChild(new QueryPoolGraphicStatisticsTest( m_testCtx, @@ -6173,7 +6179,7 @@ void QueryPoolStatisticsTests::init(void) GraphicBasicTestInstance::ParametersGraphic( VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_NORMAL, copyType[copyTypeIdx], query64Bits, false, dstOffset, CLEAR_NOOP, true), - sixRepeats)); + oneRepeat)); if (copyType[copyTypeIdx] == COPY_TYPE_CMD) primaryResetAfterCopy->addChild(new QueryPoolGraphicStatisticsTest( @@ -6184,7 +6190,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_NORMAL, copyType[copyTypeIdx], query64Bits, false, dstOffset, CLEAR_NOOP, true), - sixRepeats)); + oneRepeat)); /* Tests for clear operation within a statistics query activated. * Nothing for secondary_inherited cases can be done since it violates the specification. @@ -6203,7 +6209,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_NORMAL, copyType[copyTypeIdx], query64Bits, false, dstOffset, clearOp[clearOpIdx]), - sixRepeats)); + oneRepeat)); secondary->addChild(new QueryPoolGraphicStatisticsTest( m_testCtx, prefix + copyTypeStr[copyTypeIdx] + topology_name[topologyNdx] + clearOpStr[clearOpIdx], @@ -6211,7 +6217,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_NORMAL, copyType[copyTypeIdx], query64Bits, false, dstOffset), - sixRepeats)); + oneRepeat)); primaryHostQueryReset->addChild(new QueryPoolGraphicStatisticsTest( m_testCtx, @@ -6220,7 +6226,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_HOST, copyType[copyTypeIdx], query64Bits, false, dstOffset, clearOp[clearOpIdx]), - sixRepeats)); + oneRepeat)); secondaryHostQueryReset->addChild( new QueryPoolGraphicStatisticsTest( m_testCtx, @@ -6229,7 +6235,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_HOST, copyType[copyTypeIdx], query64Bits, false, dstOffset, clearOp[clearOpIdx]), - sixRepeats)); + oneRepeat)); primaryResetBeforeCopy->addChild(new QueryPoolGraphicStatisticsTest( m_testCtx, @@ -6238,7 +6244,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_BEFORE_COPY, copyType[copyTypeIdx], query64Bits, false, dstOffset, clearOp[clearOpIdx]), - sixRepeats)); + oneRepeat)); secondaryResetBeforeCopy->addChild( new QueryPoolGraphicStatisticsTest( m_testCtx, @@ -6247,7 +6253,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_BEFORE_COPY, copyType[copyTypeIdx], query64Bits, false, dstOffset, clearOp[clearOpIdx]), - sixRepeats)); + oneRepeat)); if (copyType[copyTypeIdx] == COPY_TYPE_CMD) { @@ -6260,7 +6266,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_AFTER_COPY, copyType[copyTypeIdx], query64Bits, false, dstOffset, clearOp[clearOpIdx]), - sixRepeats)); + oneRepeat)); secondaryResetAfterCopy->addChild( new QueryPoolGraphicStatisticsTest( m_testCtx, @@ -6270,7 +6276,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_AFTER_COPY, copyType[copyTypeIdx], query64Bits, false, dstOffset, clearOp[clearOpIdx]), - sixRepeats)); + oneRepeat)); } } @@ -6281,7 +6287,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_NORMAL, copyType[copyTypeIdx], query64Bits, false, dstOffset), - sixRepeats)); + oneRepeat)); secondaryInheritedHostQueryReset->addChild( new QueryPoolGraphicStatisticsTest( m_testCtx, prefix + copyTypeStr[copyTypeIdx] + topology_name[topologyNdx], @@ -6289,7 +6295,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_HOST, copyType[copyTypeIdx], query64Bits, false, dstOffset), - sixRepeats)); + oneRepeat)); secondaryInheritedResetBeforeCopy->addChild( new QueryPoolGraphicStatisticsTest( m_testCtx, prefix + copyTypeStr[copyTypeIdx] + topology_name[topologyNdx], @@ -6297,7 +6303,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_BEFORE_COPY, copyType[copyTypeIdx], query64Bits, false, dstOffset), - sixRepeats)); + oneRepeat)); if (copyType[copyTypeIdx] == COPY_TYPE_CMD) secondaryInheritedResetAfterCopy->addChild( new QueryPoolGraphicStatisticsTest( @@ -6306,7 +6312,7 @@ void QueryPoolStatisticsTests::init(void) VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, (VkPrimitiveTopology)topologyNdx, RESET_TYPE_AFTER_COPY, copyType[copyTypeIdx], query64Bits, false, dstOffset), - sixRepeats)); + oneRepeat)); } } }