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 "vktTestGroupUtil.hpp"
27 #include "vktAmberGraphicsFuzzTests.hpp"
28 #include "vktAmberTestCase.hpp"
37 void createAmberTests (tcu::TestCaseGroup* group)
39 tcu::TestContext& testCtx = group->getTestContext();
43 const std::string filename;
45 const char* description;
49 { "barrier-in-loop-with-break.amber", "barrier-in-loop-with-break", "A compute shader with a barrier in a loop with a break" },
50 { "color-write-in-loop.amber", "color-write-in-loop", "A fragment shader that writes to color in a loop" },
51 { "continue-and-merge.amber", "continue-and-merge", "A fragment shader with two nested loops" },
52 { "control-flow-in-function.amber", "control-flow-in-function", "A fragment shader with a lot of control flow" },
53 { "control-flow-switch.amber", "control-flow-switch", "A fragment shader with somewhat complex control flow and a switch" },
54 { "dead-barriers-in-loops.amber", "dead-barriers-in-loops", "A compute shader with dead barriers" },
55 { "dead-struct-init.amber", "dead-struct-init", "A fragment shader that uses struct initializers" },
56 { "discard-continue-return.amber", "discard-continue-return", "A fragment shader with a discard, continue, and return" },
57 { "do-while-loop-in-conditionals.amber", "do-while-loop-in-conditionals", "A fragment shader with do-while loop in conditional nest" },
58 { "early-return-and-barrier.amber", "early-return-and-barrier", "A compute shader with an early return and a barrier" },
59 { "for-condition-always-false.amber", "for-condition-always-false", "A fragment shader that uses a for loop with condition always false" },
60 { "for-with-ifs-and-return.amber", "for-with-ifs-and-return", "A fragment shader with two ifs and return/continue inside a for loop" },
61 { "fragcoord-control-flow.amber", "fragcoord-control-flow", "A fragment shader that uses FragCoord and somewhat complex control flow" },
62 { "fragcoord-control-flow-2.amber", "fragcoord-control-flow-2", "A fragment shader that uses FragCoord and somewhat complex control flow" },
63 { "if-and-switch.amber", "if-and-switch", "A fragment shader with a switch and some data flow" },
64 { "loop-nested-ifs.amber", "loop-nested-ifs", "A fragment shader with a for loop containing nested ifs" },
65 { "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" },
66 { "mat-array-distance.amber", "mat-array-distance", "A fragment shader that uses an array of matrices and distance" },
67 { "matrices-and-return-in-loop.amber", "matrices-and-return-in-loop", "A fragment shader with matrices and a return in a loop" },
68 { "max-mix-conditional-discard.amber", "max-mix-conditional-discard", "A fragment shader with an expression used in two discard guards" },
69 { "nested-ifs-and-return-in-for-loop.amber", "nested-ifs-and-return-in-for-loop", "A fragment shader with return in nest of ifs, inside loop" },
70 { "nested-loops-switch.amber", "nested-loops-switch", "A fragment shader with nested loops and a switch" },
71 { "pow-vec4.amber", "pow-vec4", "A fragment shader that uses pow" },
72 { "return-in-loop-in-function.amber", "return-in-loop-in-function", "A fragment shader with early return from loop in function" },
73 { "similar-nested-ifs.amber", "similar-nested-ifs", "A fragment shader with similar nested ifs and loops" },
74 { "struct-used-as-temporary.amber", "struct-used-as-temporary", "A fragment shader that uses a temporary struct variable" },
75 { "swizzle-struct-init-min.amber", "swizzle-struct-init-min", "A fragment shader that uses vector swizzles, struct initializers, and min" },
76 { "two-loops-set-struct.amber", "two-loops-set-struct", "A fragment shader with two loops that write to a struct" },
77 { "unreachable-barrier-in-loops.amber", "unreachable-barrier-in-loops", "A compute shader with an unreachable barrier in a loop nest" },
78 { "unreachable-loops.amber", "unreachable-loops", "Fragment shader that writes red despite unreachable loops" },
79 { "unreachable-loops-in-switch.amber", "unreachable-loops-in-switch", "A fragment shader with unreachable loops in a switch" },
80 { "while-inside-switch.amber", "while-inside-switch", "A fragment shader that uses a while loop inside a switch" },
81 { "write-before-break.amber", "write-before-break", "Fragment shader that writes red before loop break" },
82 { "write-red-after-search.amber", "write-red-after-search", "A fragment shader performing a search computation, then writing red regardless" },
83 { "write-red-in-loop-nest.amber", "write-red-in-loop-nest", "A fragment shader that writes red in a nest of loops" },
86 for (size_t i = 0; i < sizeof tests / sizeof tests[0]; i++)
87 group->addChild(createAmberTestCase(testCtx, tests[i].name, tests[i].description, "graphicsfuzz", tests[i].filename));
92 tcu::TestCaseGroup* createGraphicsFuzzTests (tcu::TestContext& testCtx)
94 return createTestGroup(testCtx, "graphicsfuzz", "Amber GraphicsFuzz Tests", createAmberTests);