1 #ifndef _VKTSPARSERESOURCESSHADERINTRINSICSSAMPLED_HPP
2 #define _VKTSPARSERESOURCESSHADERINTRINSICSSAMPLED_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 vktSparseResourcesShaderIntrinsicsSampled.hpp
23 * \brief Sparse Resources Shader Intrinsics for sampled images
24 *//*--------------------------------------------------------------------*/
26 #include "vktSparseResourcesShaderIntrinsicsBase.hpp"
33 class SparseShaderIntrinsicsCaseSampledBase : public SparseShaderIntrinsicsCaseBase
36 SparseShaderIntrinsicsCaseSampledBase (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 sparseImageOpString (const std::string& resultVariable,
47 const std::string& resultType,
48 const std::string& image,
49 const std::string& coord,
50 const std::string& miplevel) const = 0;
53 class SparseShaderIntrinsicsCaseSampledExplicit : public SparseShaderIntrinsicsCaseSampledBase
56 SparseShaderIntrinsicsCaseSampledExplicit (tcu::TestContext& testCtx,
57 const std::string& name,
58 const SpirVFunction function,
59 const ImageType imageType,
60 const tcu::UVec3& imageSize,
61 const tcu::TextureFormat& format)
62 : SparseShaderIntrinsicsCaseSampledBase (testCtx, name, function, imageType, imageSize, format) {}
64 TestInstance* createInstance (Context& context) const;
67 class SparseCaseOpImageSparseSampleExplicitLod : public SparseShaderIntrinsicsCaseSampledExplicit
70 SparseCaseOpImageSparseSampleExplicitLod (tcu::TestContext& testCtx,
71 const std::string& name,
72 const SpirVFunction function,
73 const ImageType imageType,
74 const tcu::UVec3& imageSize,
75 const tcu::TextureFormat& format)
76 : SparseShaderIntrinsicsCaseSampledExplicit (testCtx, name, function, imageType, imageSize, format) {}
78 std::string sparseImageOpString (const std::string& resultVariable,
79 const std::string& resultType,
80 const std::string& image,
81 const std::string& coord,
82 const std::string& miplevel) const;
85 class SparseShaderIntrinsicsCaseSampledImplicit : public SparseShaderIntrinsicsCaseSampledBase
88 SparseShaderIntrinsicsCaseSampledImplicit (tcu::TestContext& testCtx,
89 const std::string& name,
90 const SpirVFunction function,
91 const ImageType imageType,
92 const tcu::UVec3& imageSize,
93 const tcu::TextureFormat& format)
94 : SparseShaderIntrinsicsCaseSampledBase (testCtx, name, function, imageType, imageSize, format) {}
96 TestInstance* createInstance (Context& context) const;
99 class SparseCaseOpImageSparseSampleImplicitLod : public SparseShaderIntrinsicsCaseSampledImplicit
102 SparseCaseOpImageSparseSampleImplicitLod (tcu::TestContext& testCtx,
103 const std::string& name,
104 const SpirVFunction function,
105 const ImageType imageType,
106 const tcu::UVec3& imageSize,
107 const tcu::TextureFormat& format)
108 : SparseShaderIntrinsicsCaseSampledImplicit (testCtx, name, function, imageType, imageSize, format) {}
110 std::string sparseImageOpString (const std::string& resultVariable,
111 const std::string& resultType,
112 const std::string& image,
113 const std::string& coord,
114 const std::string& miplevel) const;
117 class SparseCaseOpImageSparseGather : public SparseShaderIntrinsicsCaseSampledImplicit
120 SparseCaseOpImageSparseGather (tcu::TestContext& testCtx,
121 const std::string& name,
122 const SpirVFunction function,
123 const ImageType imageType,
124 const tcu::UVec3& imageSize,
125 const tcu::TextureFormat& format)
126 : SparseShaderIntrinsicsCaseSampledImplicit (testCtx, name, function, imageType, imageSize, format) {}
128 std::string sparseImageOpString (const std::string& resultVariable,
129 const std::string& resultType,
130 const std::string& image,
131 const std::string& coord,
132 const std::string& miplevel) const;
138 #endif // _VKTSPARSERESOURCESSHADERINTRINSICSSAMPLED_HPP