From 56fde5bab71ff6fb6729274c55274dbcf6de79f2 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Thu, 12 May 2022 16:26:44 +0200 Subject: [PATCH] Fix entry points check for VK_KHR_draw_indirect_count VK_KHR_draw_indirect_count was promoted to core in Vulkan 1.2, but its non-KHR entry points (vkCmdDrawIndirectCount and vkCmdDrawIndexedIndirectCount) are not mandatory unless the device supports the extension. In that case, the drawIndirectCount feature bit will also be true. Any of the two checks is valid. Affected tests: dEQP-VK.api.version_check.entry_points VK-GL-CTS issue: 3679 Components: Vulkan Change-Id: I95666c1a22bed7da33f58a50307294c4048cd8ff --- .../modules/vulkan/api/vktApiVersionCheck.cpp | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp index 0af3341..fd6a767 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp @@ -448,25 +448,39 @@ private: deBool regularCheck (const APIContext& ctx, tcu::TestLog& log, deUint32& failsQuantity, const vector >& testsArr) { const deUint32 startingQuantity = failsQuantity; + for (deUint32 ndx = 0u; ndx < testsArr.size(); ++ndx) { - if (deStringEqual(testsArr[ndx].first, "vkGetInstanceProcAddr") && m_context.getUsedApiVersion() < VK_API_VERSION_1_2) + const auto& funcName = testsArr[ndx].first; + const auto& funcType = testsArr[ndx].second; + const auto apiVersion = m_context.getUsedApiVersion(); + + if (deStringEqual(funcName, "vkGetInstanceProcAddr") && apiVersion < VK_API_VERSION_1_2) continue; - const deUint32 functionType = testsArr[ndx].second; - if (functionType == FUNCTIONORIGIN_PLATFORM) - checkPlatformFunction(ctx, log, testsArr[ndx].first, DE_TRUE, failsQuantity); - else if (functionType == FUNCTIONORIGIN_INSTANCE) + // VK_KHR_draw_indirect_count was promoted to core in Vulkan 1.2, but these entrypoints are not mandatory unless the + // device supports the extension. In that case, the drawIndirectCount feature bit will also be true. Any of the two + // checks is valid. We use the extension name for convenience here. + if ((deStringEqual(funcName, "vkCmdDrawIndirectCount") || deStringEqual(funcName, "vkCmdDrawIndexedIndirectCount")) + && !isSupportedDeviceExt("VK_KHR_draw_indirect_count", apiVersion)) + continue; + + if (funcType == FUNCTIONORIGIN_PLATFORM) { - checkInstanceFunction(ctx, log, testsArr[ndx].first, DE_TRUE, failsQuantity); - checkDeviceFunction(ctx, log, testsArr[ndx].first, DE_FALSE, failsQuantity); + checkPlatformFunction(ctx, log, funcName, DE_TRUE, failsQuantity); } - else if (functionType == FUNCTIONORIGIN_DEVICE) + else if (funcType == FUNCTIONORIGIN_INSTANCE) { - checkInstanceFunction(ctx, log, testsArr[ndx].first, DE_TRUE, failsQuantity); - checkDeviceFunction(ctx, log, testsArr[ndx].first, DE_TRUE, failsQuantity); + checkInstanceFunction(ctx, log, funcName, DE_TRUE, failsQuantity); + checkDeviceFunction(ctx, log, funcName, DE_FALSE, failsQuantity); + } + else if (funcType == FUNCTIONORIGIN_DEVICE) + { + checkInstanceFunction(ctx, log, funcName, DE_TRUE, failsQuantity); + checkDeviceFunction(ctx, log, funcName, DE_TRUE, failsQuantity); } } + return startingQuantity == failsQuantity; } }; -- 2.7.4