1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
5 * Copyright (c) 2018 Intel Corporation
6 * Copyright (c) 2018 Google LLC
7 * Copyright (c) 2019 The Khronos Group Inc.
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief GraphicsFuzz tests
24 *//*--------------------------------------------------------------------*/
26 #include <amber/amber.h>
28 #include "vktAmberGraphicsFuzzTests.hpp"
29 #include "vktAmberTestCase.hpp"
30 #include "vktTestGroupUtil.hpp"
39 void createAmberTests (tcu::TestCaseGroup* group)
41 tcu::TestContext& testCtx = group->getTestContext();
47 const char *description;
51 { "continue-and-merge.amber", "continue-and-merge", "A fragment shader with two nested loops" },
52 { "control-flow-switch.amber", "control-flow-switch", "A fragment shader with somewhat complex control flow and a switch" },
53 { "dead-struct-init.amber", "dead-struct-init", "A fragment shader that uses struct initializers" },
54 { "fragcoord-control-flow.amber", "fragcoord-control-flow", "A fragment shader that uses FragCoord and somewhat complex control flow" },
55 { "fragcoord-control-flow-2.amber", "fragcoord-control-flow-2", "A fragment shader that uses FragCoord and somewhat complex control flow" },
56 { "mat-array-deep-control-flow.amber", "mat-array-deep-control-flow", "A fragment shader that uses an array of matrices and has deep control flow" },
57 { "mat-array-distance.amber", "mat-array-distance", "A fragment shader that uses an array of matrices and distance" },
58 { "pow-vec4.amber", "pow-vec4", "A fragment shader that uses pow" },
59 { "swizzle-struct-init-min.amber", "swizzle-struct-init-min", "A fragment shader that uses vector swizzles, struct initializers, and min" },
60 { "while-inside-switch.amber", "while-inside-switch", "A fragment shader that uses a while loop inside a switch" },
63 for (size_t i = 0; i < sizeof tests / sizeof tests[0]; i++)
65 // .amber files are saved in <path>/external/vulkancts/data/vulkan/amber/<categoryname>/
66 AmberTestCase *testCase = new AmberTestCase(testCtx, tests[i].name, tests[i].description);
68 // Make sure the input can be parsed before we use it.
69 if (testCase->parse("graphicsfuzz", tests[i].filename))
71 group->addChild(testCase);
77 TCU_THROW(InternalError, "Failed to parse amber file");
84 tcu::TestCaseGroup* createGraphicsFuzzTests (tcu::TestContext& testCtx)
86 return createTestGroup(testCtx, "graphicsfuzz", "Amber GraphicsFuzz Tests", createAmberTests);