1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
5 * Copyright (c) 2022 The Khronos Group Inc.
6 * Copyright (c) 2022 Google LLC
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 * \brief Shader invocations tests
23 *//*--------------------------------------------------------------------*/
25 #include "vktDrawShaderInvocationTests.hpp"
26 #include "vktTestGroupUtil.hpp"
27 #include "amber/vktAmberTestCase.hpp"
29 #include "tcuTestCase.hpp"
40 void checkHelperInvocationTestSupport(Context& context, std::string testName)
44 if ((context.getSubgroupProperties().supportedOperations & VK_SUBGROUP_FEATURE_QUAD_BIT) == 0u)
46 TCU_THROW(NotSupportedError, "Device does not support subgroup quad operations");
49 if (!context.isDeviceFunctionalitySupported("VK_EXT_shader_demote_to_helper_invocation"))
51 TCU_THROW(NotSupportedError, "VK_EXT_shader_demote_to_helper_invocation not supported.");
55 void createTests(tcu::TestCaseGroup* testGroup)
57 tcu::TestContext& testCtx = testGroup->getTestContext();
58 static const char dataDir[] = "draw/shader_invocation";
59 cts_amber::AmberTestCase* testCase = cts_amber::createAmberTestCase(testCtx, "helper_invocation", "", dataDir, "helper_invocation.amber");
61 testCase->setCheckSupportCallback(checkHelperInvocationTestSupport);
63 testGroup->addChild(testCase);
68 tcu::TestCaseGroup* createShaderInvocationTests(tcu::TestContext& testCtx)
70 return createTestGroup(testCtx, "shader_invocation", "Shader Invocation tests", createTests);