1 #ifndef _VKTSPARSERESOURCESSHADERINTRINSICSSTORAGE_HPP
2 #define _VKTSPARSERESOURCESSHADERINTRINSICSSTORAGE_HPP
3 /*------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2016 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.
22 * \file vktSparseResourcesShaderIntrinsicsStorage.hpp
23 * \brief Sparse Resources Shader Intrinsics for storage images
24 *//*--------------------------------------------------------------------*/
26 #include "vktSparseResourcesShaderIntrinsicsBase.hpp"
33 class SparseShaderIntrinsicsCaseStorage : public SparseShaderIntrinsicsCaseBase
36 SparseShaderIntrinsicsCaseStorage (tcu::TestContext& testCtx,
37 const std::string& name,
38 const SpirVFunction function,
39 const ImageType imageType,
40 const tcu::UVec3& imageSize,
41 const tcu::TextureFormat& format)
42 : SparseShaderIntrinsicsCaseBase (testCtx, name, function, imageType, imageSize, format) {}
44 void initPrograms (vk::SourceCollections& programCollection) const;
46 virtual std::string getSparseImageTypeName (void) const = 0;
47 virtual std::string getUniformConstSparseImageTypeName (void) const = 0;
49 virtual std::string sparseImageOpString (const std::string& resultVariable,
50 const std::string& resultType,
51 const std::string& image,
52 const std::string& coord,
53 const std::string& mipLevel) const = 0;
56 class SparseCaseOpImageSparseFetch : public SparseShaderIntrinsicsCaseStorage
59 SparseCaseOpImageSparseFetch (tcu::TestContext& testCtx,
60 const std::string& name,
61 const SpirVFunction function,
62 const ImageType imageType,
63 const tcu::UVec3& imageSize,
64 const tcu::TextureFormat& format)
65 : SparseShaderIntrinsicsCaseStorage (testCtx, name, function, imageType, imageSize, format) {}
67 TestInstance* createInstance (Context& context) const;
69 std::string getSparseImageTypeName (void) const;
70 std::string getUniformConstSparseImageTypeName (void) const;
72 std::string sparseImageOpString (const std::string& resultVariable,
73 const std::string& resultType,
74 const std::string& image,
75 const std::string& coord,
76 const std::string& mipLevel) const;
79 class SparseCaseOpImageSparseRead : public SparseShaderIntrinsicsCaseStorage
82 SparseCaseOpImageSparseRead (tcu::TestContext& testCtx,
83 const std::string& name,
84 const SpirVFunction function,
85 const ImageType imageType,
86 const tcu::UVec3& imageSize,
87 const tcu::TextureFormat& format)
88 : SparseShaderIntrinsicsCaseStorage (testCtx, name, function, imageType, imageSize, format) {}
90 TestInstance* createInstance (Context& context) const;
92 std::string getSparseImageTypeName (void) const;
93 std::string getUniformConstSparseImageTypeName (void) const;
95 std::string sparseImageOpString (const std::string& resultVariable,
96 const std::string& resultType,
97 const std::string& image,
98 const std::string& coord,
99 const std::string& mipLevel) const;
105 #endif // _VKTSPARSERESOURCESSHADERINTRINSICSSTORAGE_HPP