dEQP-VK.graphicsfuzz.max-mix-conditional-discard
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / amber / vktAmberGraphicsFuzzTests.cpp
1 /*------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2018 Intel Corporation
6  * Copyright (c) 2018 Google LLC
7  * Copyright (c) 2019 The Khronos Group Inc.
8  *
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
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  *//*!
22  * \file
23  * \brief GraphicsFuzz tests
24  *//*--------------------------------------------------------------------*/
25
26 #include "vktTestGroupUtil.hpp"
27 #include "vktAmberGraphicsFuzzTests.hpp"
28 #include "vktAmberTestCase.hpp"
29
30 namespace vkt
31 {
32 namespace cts_amber
33 {
34 namespace
35 {
36
37 void createAmberTests (tcu::TestCaseGroup* group)
38 {
39         tcu::TestContext& testCtx = group->getTestContext();
40
41         static const struct
42         {
43                 const std::string       filename;
44                 const char*                     name;
45                 const char*                     description;
46         }
47         tests[] =
48         {
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-switch.amber",                                    "control-flow-switch",                                  "A fragment shader with somewhat complex control flow and a switch"                                             },
53                 {       "dead-barriers-in-loops.amber",                                 "dead-barriers-in-loops",                               "A compute shader with dead barriers"                                                                                                   },
54                 {       "dead-struct-init.amber",                                               "dead-struct-init",                                             "A fragment shader that uses struct initializers"                                                                               },
55                 {       "do-while-loop-in-conditionals.amber",                  "do-while-loop-in-conditionals",                "A fragment shader with do-while loop in conditional nest"                                                              },
56                 {       "early-return-and-barrier.amber",                               "early-return-and-barrier",                             "A compute shader with an early return and a barrier"                                                                   },
57                 {       "for-condition-always-false.amber",                             "for-condition-always-false",                   "A fragment shader that uses a for loop with condition always false"                                    },
58                 {       "for-with-ifs-and-return.amber",                                "for-with-ifs-and-return",                              "A fragment shader with two ifs and return/continue inside a for loop"                                  },
59                 {       "fragcoord-control-flow.amber",                                 "fragcoord-control-flow",                               "A fragment shader that uses FragCoord and somewhat complex control flow"                               },
60                 {       "fragcoord-control-flow-2.amber",                               "fragcoord-control-flow-2",                             "A fragment shader that uses FragCoord and somewhat complex control flow"                               },
61                 {       "if-and-switch.amber",                                                  "if-and-switch",                                                "A fragment shader with a switch and some data flow"                                                                    },
62                 {       "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"                    },
63                 {       "mat-array-distance.amber",                                             "mat-array-distance",                                   "A fragment shader that uses an array of matrices and distance"                                                 },
64                 {       "matrices-and-return-in-loop.amber",                    "matrices-and-return-in-loop",                  "A fragment shader with matrices and a return in a loop"                                                                },
65                 {       "max-mix-conditional-discard.amber",                    "max-mix-conditional-discard",                  "A fragment shader with an expression used in two discard guards"                                               },
66                 {       "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"                                                             },
67                 {       "pow-vec4.amber",                                                               "pow-vec4",                                                             "A fragment shader that uses pow"                                                                                                               },
68                 {       "return-in-loop-in-function.amber",                             "return-in-loop-in-function",                   "A fragment shader with early return from loop in function"                                                             },
69                 {       "similar-nested-ifs.amber",                                             "similar-nested-ifs",                                   "A fragment shader with similar nested ifs and loops"                                                                   },
70                 {       "struct-used-as-temporary.amber",                               "struct-used-as-temporary",                             "A fragment shader that uses a temporary struct variable"                                                               },
71                 {       "swizzle-struct-init-min.amber",                                "swizzle-struct-init-min",                              "A fragment shader that uses vector swizzles, struct initializers, and min"                             },
72                 {       "two-loops-set-struct.amber",                                   "two-loops-set-struct",                                 "A fragment shader with two loops that write to a struct"                                                               },
73                 {       "unreachable-barrier-in-loops.amber",                   "unreachable-barrier-in-loops",                 "A compute shader with an unreachable barrier in a loop nest"                                                   },
74                 {       "unreachable-loops.amber",                                              "unreachable-loops",                                    "Fragment shader that writes red despite unreachable loops"                                                             },
75                 {       "unreachable-loops-in-switch.amber",                    "unreachable-loops-in-switch",                  "A fragment shader with unreachable loops in a switch"                                                                  },
76                 {       "while-inside-switch.amber",                                    "while-inside-switch",                                  "A fragment shader that uses a while loop inside a switch"                                                              },
77                 {       "write-before-break.amber",                                             "write-before-break",                                   "Fragment shader that writes red before loop break"                                                                             },
78                 {       "write-red-after-search.amber",                                 "write-red-after-search",                               "A fragment shader performing a search computation, then writing red regardless"                },
79                 {       "write-red-in-loop-nest.amber",                                 "write-red-in-loop-nest",                               "A fragment shader that writes red in a nest of loops"                                                                  },
80         };
81
82         for (size_t i = 0; i < sizeof tests / sizeof tests[0]; i++)
83                 group->addChild(createAmberTestCase(testCtx, tests[i].name, tests[i].description, "graphicsfuzz", tests[i].filename));
84 }
85
86 } // anonymous
87
88 tcu::TestCaseGroup* createGraphicsFuzzTests (tcu::TestContext& testCtx)
89 {
90         return createTestGroup(testCtx, "graphicsfuzz", "Amber GraphicsFuzz Tests", createAmberTests);
91 }
92
93 } // cts_amber
94 } // vkt