• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 	{
53 		{ "depth_bias_triangle_list_fill",		{} },
54 		{ "depth_bias_triangle_list_line",		{ "Features.fillModeNonSolid" } },
55 		{ "depth_bias_triangle_list_point",		{ "Features.fillModeNonSolid" } },
56 		{ "depth_bias_patch_list_tri_fill",		{ "Features.tessellationShader" } },
57 		{ "depth_bias_patch_list_tri_line",		{ "Features.tessellationShader", "Features.fillModeNonSolid" } },
58 		{ "depth_bias_patch_list_tri_point",	{ "Features.tessellationShader", "Features.fillModeNonSolid" } }
59 	};
60 
61 	for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
62 	{
63 		std::vector<std::string>	requirements	= cases[i].testRequirements;
64 		const std::string			fileName		= cases[i].testName + ".amber";
65 		cts_amber::AmberTestCase*	testCase		= cts_amber::createAmberTestCase(testCtx, cases[i].testName.c_str(), "", dataDir, fileName, requirements);
66 		testGroup->addChild(testCase);
67 	}
68 }
69 
70 } // anonymous
71 
createDepthBiasTests(tcu::TestContext & testCtx)72 tcu::TestCaseGroup* createDepthBiasTests (tcu::TestContext& testCtx)
73 {
74 	return createTestGroup(testCtx, "depth_bias", "Depth bias tests", createTests);
75 }
76 
77 }	// Draw
78 }	// vkt
79