Check for drawIndirectFirstInstance should only affect indirect draw calls
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 23 Mar 2021 23:38:35 +0000 (00:38 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 1 Apr 2021 12:47:21 +0000 (12:47 +0000)
Without this change, if any driver doesn't support that feature, then
non-indirect draw calls, like vkCmdDrawIndexed are also tested using
only firstInstance==0.

Affects:
dEQP-VK.draw.instanced.*

Components: Vulkan

VK-GL-CTS issue: 2857

Change-Id: I432d5760258848d30e101baf702495980d2116fe

external/vulkancts/modules/vulkan/draw/vktDrawInstancedTests.cpp

index ad28aff..9c32e12 100644 (file)
@@ -519,11 +519,13 @@ tcu::TestStatus InstancedDrawInstance::iterate()
        qpTestResult                    res                                             = QP_TEST_RESULT_PASS;
 
        const vk::VkClearColorValue clearColor = { { 0.0f, 0.0f, 0.0f, 1.0f } };
-       int firstInstanceIndicesCount = 1;
+       int firstInstanceIndicesCount = DE_LENGTH_OF_ARRAY(firstInstanceIndices);
 
        // Require 'drawIndirectFirstInstance' feature to run non-zero firstInstance indirect draw tests.
-       if (m_context.getDeviceFeatures().drawIndirectFirstInstance)
-               firstInstanceIndicesCount = DE_LENGTH_OF_ARRAY(firstInstanceIndices);
+       if (m_params.function == TestParams::FUNCTION_DRAW_INDIRECT && !m_context.getDeviceFeatures().drawIndirectFirstInstance)
+       {
+               firstInstanceIndicesCount = 1;
+       }
 
        for (int instanceCountNdx = 0; instanceCountNdx < DE_LENGTH_OF_ARRAY(instanceCounts); instanceCountNdx++)
        {