xref: /aosp_15_r20/external/deqp/external/vulkancts/modules/vulkan/texture/vktTextureTexelOffsetTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 /*------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2020 The Khronos Group Inc.
6  * Copyright (c) 2020 Google 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 Texel buffer tests.
23  *//*--------------------------------------------------------------------*/
24 
25 #include "vktTextureTexelOffsetTests.hpp"
26 #include "vktAmberTestCase.hpp"
27 #include "vktTestGroupUtil.hpp"
28 
29 using namespace vk;
30 
31 namespace vkt
32 {
33 namespace texture
34 {
35 
createTextureTexelOffsetTests(tcu::TestContext & testCtx)36 tcu::TestCaseGroup *createTextureTexelOffsetTests(tcu::TestContext &testCtx)
37 {
38     de::MovePtr<tcu::TestCaseGroup> texelOffset(new tcu::TestCaseGroup(testCtx, "texel_offset"));
39 #ifndef CTS_USES_VULKANSC
40     static const char dataDir[]         = "texture/texel_offset";
41     static const std::string cases[][2] = {
42         {"texel_offset", "A fragment shader that uses texture loads with an offset specified"}};
43 
44     for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
45     {
46         const std::string fileName = cases[i][0] + ".amber";
47         cts_amber::AmberTestCase *testCase =
48             cts_amber::createAmberTestCase(testCtx, cases[i][0].c_str(), cases[i][1].c_str(), dataDir, fileName);
49 
50         texelOffset->addChild(testCase);
51     }
52 #endif
53 
54     return texelOffset.release();
55 }
56 
57 } // namespace texture
58 } // namespace vkt
59