1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
4 *
5 * Copyright (c) 2021-2022 Google Inc.
6 * Copyright (c) 2021-2022 The Khronos Group Inc.
7 *
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
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
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.
19 *
20 *//*!
21 * \file
22 * \brief Depth bias tests
23 *//*--------------------------------------------------------------------*/
24
25 #include "vktDrawDepthBiasTests.hpp"
26 #include "vktTestGroupUtil.hpp"
27 #include "amber/vktAmberTestCase.hpp"
28
29 #include "tcuTestCase.hpp"
30
31 #include <string>
32
33 namespace vkt
34 {
35 namespace Draw
36 {
37 namespace
38 {
39
createTests(tcu::TestCaseGroup * testGroup)40 void createTests(tcu::TestCaseGroup *testGroup)
41 {
42 tcu::TestContext &testCtx = testGroup->getTestContext();
43 static const char dataDir[] = "draw/depth_bias";
44
45 struct depthBiasCase
46 {
47 std::string testName;
48 std::vector<std::string> testRequirements;
49 };
50
51 static const depthBiasCase cases[] = {
52 {"depth_bias_triangle_list_fill", {}},
53 {"depth_bias_triangle_list_line", {"Features.fillModeNonSolid"}},
54 {"depth_bias_triangle_list_point", {"Features.fillModeNonSolid"}},
55 {"depth_bias_patch_list_tri_fill", {"Features.tessellationShader"}},
56 {"depth_bias_patch_list_tri_line", {"Features.tessellationShader", "Features.fillModeNonSolid"}},
57 {"depth_bias_patch_list_tri_point", {"Features.tessellationShader", "Features.fillModeNonSolid"}}};
58
59 for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
60 {
61 std::vector<std::string> requirements = cases[i].testRequirements;
62 const std::string fileName = cases[i].testName + ".amber";
63 cts_amber::AmberTestCase *testCase =
64 cts_amber::createAmberTestCase(testCtx, cases[i].testName.c_str(), dataDir, fileName, requirements);
65 testGroup->addChild(testCase);
66 }
67 }
68
69 } // namespace
70
createDepthBiasTests(tcu::TestContext & testCtx)71 tcu::TestCaseGroup *createDepthBiasTests(tcu::TestContext &testCtx)
72 {
73 return createTestGroup(testCtx, "depth_bias", createTests);
74 }
75
76 } // namespace Draw
77 } // namespace vkt
78