1 /*------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2020 Google Inc.
6  * Copyright (c) 2020 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 Fragment output location tests
23  *//*--------------------------------------------------------------------*/
24 
25 #include "vktDrawOutputLocationTests.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 
44 	// .array
45 	{
46 		tcu::TestCaseGroup* const	array		= new tcu::TestCaseGroup(testCtx, "array", "Test output location array");
47 		static const char			dataDir[]	= "draw/output_location/array";
48 
49 		static const std::string	cases[]		=
50 		{
51 			"b10g11r11-ufloat-pack32-highp",
52 			"b10g11r11-ufloat-pack32-highp-output-float",
53 			"b10g11r11-ufloat-pack32-highp-output-vec2",
54 			"b10g11r11-ufloat-pack32-mediump",
55 			"b10g11r11-ufloat-pack32-mediump-output-float",
56 			"b10g11r11-ufloat-pack32-mediump-output-vec2",
57 			"b8g8r8a8-unorm-highp",
58 			"b8g8r8a8-unorm-highp-output-vec2",
59 			"b8g8r8a8-unorm-highp-output-vec3",
60 			"b8g8r8a8-unorm-mediump",
61 			"b8g8r8a8-unorm-mediump-output-vec2",
62 			"b8g8r8a8-unorm-mediump-output-vec3",
63 			"r16g16-sfloat-highp",
64 			"r16g16-sfloat-highp-output-float",
65 			"r16g16-sfloat-mediump",
66 			"r16g16-sfloat-mediump-output-float",
67 			"r32g32b32a32-sfloat-highp",
68 			"r32g32b32a32-sfloat-highp-output-vec2",
69 			"r32g32b32a32-sfloat-highp-output-vec3",
70 			"r32g32b32a32-sfloat-mediump",
71 			"r32g32b32a32-sfloat-mediump-output-vec2",
72 			"r32g32b32a32-sfloat-mediump-output-vec3",
73 			"r32-sfloat-highp",
74 			"r32-sfloat-mediump",
75 			"r8g8-uint-highp",
76 			"r8g8-uint-highp-output-uint",
77 			"r8g8-uint-mediump",
78 			"r8g8-uint-mediump-output-uint"
79 		};
80 
81 		testGroup->addChild(array);
82 
83 		for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
84 		{
85 			const std::string			fileName	= cases[i] + ".amber";
86 			cts_amber::AmberTestCase*	testCase	= cts_amber::createAmberTestCase(testCtx, cases[i].c_str(), "", dataDir, fileName);
87 
88 			array->addChild(testCase);
89 		}
90 	}
91 
92 	// .shuffle
93 	{
94 		tcu::TestCaseGroup* const	shuffle		= new tcu::TestCaseGroup(testCtx, "shuffle", "Test output location shuffling");
95 		static const char			dataDir[]	= "draw/output_location/shuffle";
96 
97 		static const std::string	cases[]		=
98 		{
99 			"inputs-outputs",
100 			"inputs-outputs-mod"
101 		};
102 
103 		testGroup->addChild(shuffle);
104 
105 		for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
106 		{
107 			const std::string			fileName	= cases[i] + ".amber";
108 			cts_amber::AmberTestCase*	testCase	= cts_amber::createAmberTestCase(testCtx, cases[i].c_str(), "", dataDir, fileName);
109 
110 			shuffle->addChild(testCase);
111 		}
112 	}
113 }
114 
115 } // anonymous
116 
createOutputLocationTests(tcu::TestContext & testCtx)117 tcu::TestCaseGroup* createOutputLocationTests (tcu::TestContext& testCtx)
118 {
119 	return createTestGroup(testCtx, "output_location", "Fragment output location tests", createTests);
120 }
121 
122 }	// Draw
123 }	// vkt
124