• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2019 Google LLC
6  * Copyright (c) 2019 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 Tests for non robust oob buffer access in unexecuted shder code
23  *        paths.
24  *//*--------------------------------------------------------------------*/
25 
26 #include "vktNonRobustBufferAccessTests.hpp"
27 #include "amber/vktAmberTestCase.hpp"
28 
29 #include <vector>
30 #include <utility>
31 #include <string>
32 
33 namespace vkt
34 {
35 namespace robustness
36 {
37 using namespace cts_amber;
38 
createNonRobustBufferAccessTests(tcu::TestContext & testCtx)39 tcu::TestCaseGroup*	createNonRobustBufferAccessTests (tcu::TestContext& testCtx)
40 {
41 	static const std::string										kGroupName					= "non_robust_buffer_access";
42 	static const std::vector<std::pair<std::string, std::string>>	nonRobustBufferAccessTests	=
43 	{
44 		{ "unexecuted_oob_underflow",	"Test for correct handling of buffer access index underflow in unexecuted shader code paths" },
45 		{ "unexecuted_oob_overflow",	"Test for correct handling of buffer access index overflow in unexecuted shader code paths" }
46 	};
47 
48 	de::MovePtr<tcu::TestCaseGroup> group{new tcu::TestCaseGroup{testCtx, kGroupName.c_str(), "Non-robust buffer access test group"}};
49 #ifndef CTS_USES_VULKANSC
50 	for (const auto& test : nonRobustBufferAccessTests)
51 	{
52 		group->addChild(createAmberTestCase(testCtx, test.first.c_str(), test.second.c_str(), kGroupName.c_str(), test.first + ".amber"));
53 	}
54 #endif
55 
56 	return group.release();
57 }
58 
59 } // cts_amber
60 } // vkt
61