1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
5 * Copyright (c) 2020 Google Inc.
6 * Copyright (c) 2020 The Khronos Group Inc.
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 Fragment output location tests
23 *//*--------------------------------------------------------------------*/
25 #include "vktDrawOutputLocationTests.hpp"
26 #include "vktTestGroupUtil.hpp"
27 #include "amber/vktAmberTestCase.hpp"
29 #include "tcuTestCase.hpp"
40 void checkSupport (Context& context, std::string testName)
42 if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset")
43 && context.getPortabilitySubsetProperties().minVertexInputBindingStrideAlignment == 4
44 && (testName.find("r8g8") != std::string::npos || testName.find("inputs-outputs-mod") != std::string::npos))
46 TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Stride is not a multiple of minVertexInputBindingStrideAlignment");
50 void createTests (tcu::TestCaseGroup* testGroup)
52 #ifndef CTS_USES_VULKANSC
53 tcu::TestContext& testCtx = testGroup->getTestContext();
57 tcu::TestCaseGroup* const array = new tcu::TestCaseGroup(testCtx, "array", "Test output location array");
58 static const char dataDir[] = "draw/output_location/array";
60 static const std::string cases[] =
62 "b10g11r11-ufloat-pack32-highp",
63 "b10g11r11-ufloat-pack32-highp-output-float",
64 "b10g11r11-ufloat-pack32-highp-output-vec2",
65 "b10g11r11-ufloat-pack32-mediump",
66 "b10g11r11-ufloat-pack32-mediump-output-float",
67 "b10g11r11-ufloat-pack32-mediump-output-vec2",
68 "b8g8r8a8-unorm-highp",
69 "b8g8r8a8-unorm-highp-output-vec2",
70 "b8g8r8a8-unorm-highp-output-vec3",
71 "b8g8r8a8-unorm-mediump",
72 "b8g8r8a8-unorm-mediump-output-vec2",
73 "b8g8r8a8-unorm-mediump-output-vec3",
74 "r16g16-sfloat-highp",
75 "r16g16-sfloat-highp-output-float",
76 "r16g16-sfloat-mediump",
77 "r16g16-sfloat-mediump-output-float",
78 "r32g32b32a32-sfloat-highp",
79 "r32g32b32a32-sfloat-highp-output-vec2",
80 "r32g32b32a32-sfloat-highp-output-vec3",
81 "r32g32b32a32-sfloat-mediump",
82 "r32g32b32a32-sfloat-mediump-output-vec2",
83 "r32g32b32a32-sfloat-mediump-output-vec3",
87 "r8g8-uint-highp-output-uint",
89 "r8g8-uint-mediump-output-uint"
92 testGroup->addChild(array);
94 for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
96 const std::string fileName = cases[i] + ".amber";
97 cts_amber::AmberTestCase* testCase = cts_amber::createAmberTestCase(testCtx, cases[i].c_str(), "", dataDir, fileName);
99 testCase->setCheckSupportCallback(checkSupport);
100 array->addChild(testCase);
106 tcu::TestCaseGroup* const shuffle = new tcu::TestCaseGroup(testCtx, "shuffle", "Test output location shuffling");
107 static const char dataDir[] = "draw/output_location/shuffle";
109 static const std::string cases[] =
115 testGroup->addChild(shuffle);
116 for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
118 const std::string fileName = cases[i] + ".amber";
119 cts_amber::AmberTestCase* testCase = cts_amber::createAmberTestCase(testCtx, cases[i].c_str(), "", dataDir, fileName);
121 shuffle->addChild(testCase);
131 tcu::TestCaseGroup* createOutputLocationTests (tcu::TestContext& testCtx)
133 return createTestGroup(testCtx, "output_location", "Fragment output location tests", createTests);