1fd4e5da5Sopenharmony_ci// Copyright (c) 2015-2016 The Khronos Group Inc. 2fd4e5da5Sopenharmony_ci// 3fd4e5da5Sopenharmony_ci// Licensed under the Apache License, Version 2.0 (the "License"); 4fd4e5da5Sopenharmony_ci// you may not use this file except in compliance with the License. 5fd4e5da5Sopenharmony_ci// You may obtain a copy of the License at 6fd4e5da5Sopenharmony_ci// 7fd4e5da5Sopenharmony_ci// http://www.apache.org/licenses/LICENSE-2.0 8fd4e5da5Sopenharmony_ci// 9fd4e5da5Sopenharmony_ci// Unless required by applicable law or agreed to in writing, software 10fd4e5da5Sopenharmony_ci// distributed under the License is distributed on an "AS IS" BASIS, 11fd4e5da5Sopenharmony_ci// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12fd4e5da5Sopenharmony_ci// See the License for the specific language governing permissions and 13fd4e5da5Sopenharmony_ci// limitations under the License. 14fd4e5da5Sopenharmony_ci 15fd4e5da5Sopenharmony_ci// Test capability dependencies for enums. 16fd4e5da5Sopenharmony_ci 17fd4e5da5Sopenharmony_ci#include <tuple> 18fd4e5da5Sopenharmony_ci#include <vector> 19fd4e5da5Sopenharmony_ci 20fd4e5da5Sopenharmony_ci#include "gmock/gmock.h" 21fd4e5da5Sopenharmony_ci#include "source/assembly_grammar.h" 22fd4e5da5Sopenharmony_ci#include "source/enum_set.h" 23fd4e5da5Sopenharmony_ci#include "source/operand.h" 24fd4e5da5Sopenharmony_ci#include "test/unit_spirv.h" 25fd4e5da5Sopenharmony_ci 26fd4e5da5Sopenharmony_cinamespace spvtools { 27fd4e5da5Sopenharmony_cinamespace { 28fd4e5da5Sopenharmony_ci 29fd4e5da5Sopenharmony_ciusing spvtest::ElementsIn; 30fd4e5da5Sopenharmony_ciusing ::testing::Combine; 31fd4e5da5Sopenharmony_ciusing ::testing::Eq; 32fd4e5da5Sopenharmony_ciusing ::testing::TestWithParam; 33fd4e5da5Sopenharmony_ciusing ::testing::Values; 34fd4e5da5Sopenharmony_ciusing ::testing::ValuesIn; 35fd4e5da5Sopenharmony_ci 36fd4e5da5Sopenharmony_ci// Emits a CapabilitySet to the given ostream, returning the ostream. 37fd4e5da5Sopenharmony_ciinline std::ostream& operator<<(std::ostream& out, const CapabilitySet& cs) { 38fd4e5da5Sopenharmony_ci out << "CapabilitySet{"; 39fd4e5da5Sopenharmony_ci auto ctx = spvContextCreate(SPV_ENV_UNIVERSAL_1_0); 40fd4e5da5Sopenharmony_ci spvtools::AssemblyGrammar grammar(ctx); 41fd4e5da5Sopenharmony_ci bool first = true; 42fd4e5da5Sopenharmony_ci for (auto c : cs) { 43fd4e5da5Sopenharmony_ci if (!first) { 44fd4e5da5Sopenharmony_ci out << " "; 45fd4e5da5Sopenharmony_ci first = false; 46fd4e5da5Sopenharmony_ci } 47fd4e5da5Sopenharmony_ci out << grammar.lookupOperandName(SPV_OPERAND_TYPE_CAPABILITY, uint32_t(c)) 48fd4e5da5Sopenharmony_ci << "(" << uint32_t(c) << ")"; 49fd4e5da5Sopenharmony_ci } 50fd4e5da5Sopenharmony_ci spvContextDestroy(ctx); 51fd4e5da5Sopenharmony_ci out << "}"; 52fd4e5da5Sopenharmony_ci return out; 53fd4e5da5Sopenharmony_ci} 54fd4e5da5Sopenharmony_ci 55fd4e5da5Sopenharmony_ci// A test case for mapping an enum to a capability mask. 56fd4e5da5Sopenharmony_cistruct EnumCapabilityCase { 57fd4e5da5Sopenharmony_ci spv_operand_type_t type; 58fd4e5da5Sopenharmony_ci uint32_t value; 59fd4e5da5Sopenharmony_ci CapabilitySet expected_capabilities; 60fd4e5da5Sopenharmony_ci}; 61fd4e5da5Sopenharmony_ci// Emits an EnumCapabilityCase to the ostream, returning the ostream. 62fd4e5da5Sopenharmony_ciinline std::ostream& operator<<(std::ostream& out, 63fd4e5da5Sopenharmony_ci const EnumCapabilityCase& ecc) { 64fd4e5da5Sopenharmony_ci out << "EnumCapabilityCase{ " << spvOperandTypeStr(ecc.type) << "(" 65fd4e5da5Sopenharmony_ci << unsigned(ecc.type) << "), " << ecc.value << ", " 66fd4e5da5Sopenharmony_ci << ecc.expected_capabilities << "}"; 67fd4e5da5Sopenharmony_ci return out; 68fd4e5da5Sopenharmony_ci} 69fd4e5da5Sopenharmony_ci 70fd4e5da5Sopenharmony_ci// Test fixture for testing EnumCapabilityCases. 71fd4e5da5Sopenharmony_ciusing EnumCapabilityTest = 72fd4e5da5Sopenharmony_ci TestWithParam<std::tuple<spv_target_env, EnumCapabilityCase>>; 73fd4e5da5Sopenharmony_ci 74fd4e5da5Sopenharmony_ciTEST_P(EnumCapabilityTest, Sample) { 75fd4e5da5Sopenharmony_ci const auto env = std::get<0>(GetParam()); 76fd4e5da5Sopenharmony_ci const auto context = spvContextCreate(env); 77fd4e5da5Sopenharmony_ci const AssemblyGrammar grammar(context); 78fd4e5da5Sopenharmony_ci spv_operand_desc entry; 79fd4e5da5Sopenharmony_ci 80fd4e5da5Sopenharmony_ci ASSERT_EQ(SPV_SUCCESS, 81fd4e5da5Sopenharmony_ci grammar.lookupOperand(std::get<1>(GetParam()).type, 82fd4e5da5Sopenharmony_ci std::get<1>(GetParam()).value, &entry)); 83fd4e5da5Sopenharmony_ci const auto cap_set = grammar.filterCapsAgainstTargetEnv( 84fd4e5da5Sopenharmony_ci entry->capabilities, entry->numCapabilities); 85fd4e5da5Sopenharmony_ci 86fd4e5da5Sopenharmony_ci EXPECT_THAT(ElementsIn(cap_set), 87fd4e5da5Sopenharmony_ci Eq(ElementsIn(std::get<1>(GetParam()).expected_capabilities))) 88fd4e5da5Sopenharmony_ci << " enum value " << std::get<1>(GetParam()).value; 89fd4e5da5Sopenharmony_ci spvContextDestroy(context); 90fd4e5da5Sopenharmony_ci} 91fd4e5da5Sopenharmony_ci 92fd4e5da5Sopenharmony_ci#define CASE0(TYPE, VALUE) \ 93fd4e5da5Sopenharmony_ci { \ 94fd4e5da5Sopenharmony_ci SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), {} \ 95fd4e5da5Sopenharmony_ci } 96fd4e5da5Sopenharmony_ci#define CASE1(TYPE, VALUE, CAP) \ 97fd4e5da5Sopenharmony_ci { \ 98fd4e5da5Sopenharmony_ci SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), CapabilitySet { \ 99fd4e5da5Sopenharmony_ci spv::Capability::CAP \ 100fd4e5da5Sopenharmony_ci } \ 101fd4e5da5Sopenharmony_ci } 102fd4e5da5Sopenharmony_ci#define CASE2(TYPE, VALUE, CAP1, CAP2) \ 103fd4e5da5Sopenharmony_ci { \ 104fd4e5da5Sopenharmony_ci SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), CapabilitySet { \ 105fd4e5da5Sopenharmony_ci spv::Capability::CAP1, spv::Capability::CAP2 \ 106fd4e5da5Sopenharmony_ci } \ 107fd4e5da5Sopenharmony_ci } 108fd4e5da5Sopenharmony_ci#define CASE3(TYPE, VALUE, CAP1, CAP2, CAP3) \ 109fd4e5da5Sopenharmony_ci { \ 110fd4e5da5Sopenharmony_ci SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), CapabilitySet { \ 111fd4e5da5Sopenharmony_ci spv::Capability::CAP1, spv::Capability::CAP2, spv::Capability::CAP3 \ 112fd4e5da5Sopenharmony_ci } \ 113fd4e5da5Sopenharmony_ci } 114fd4e5da5Sopenharmony_ci#define CASE4(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4) \ 115fd4e5da5Sopenharmony_ci { \ 116fd4e5da5Sopenharmony_ci SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), CapabilitySet { \ 117fd4e5da5Sopenharmony_ci spv::Capability::CAP1, spv::Capability::CAP2, spv::Capability::CAP3, \ 118fd4e5da5Sopenharmony_ci spv::Capability::CAP4 \ 119fd4e5da5Sopenharmony_ci } \ 120fd4e5da5Sopenharmony_ci } 121fd4e5da5Sopenharmony_ci#define CASE5(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4, CAP5) \ 122fd4e5da5Sopenharmony_ci { \ 123fd4e5da5Sopenharmony_ci SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), CapabilitySet { \ 124fd4e5da5Sopenharmony_ci spv::Capability::CAP1, spv::Capability::CAP2, spv::Capability::CAP3, \ 125fd4e5da5Sopenharmony_ci spv::Capability::CAP4, spv::Capability::CAP5 \ 126fd4e5da5Sopenharmony_ci } \ 127fd4e5da5Sopenharmony_ci } 128fd4e5da5Sopenharmony_ci 129fd4e5da5Sopenharmony_ci#define CASE6(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4, CAP5, CAP6) \ 130fd4e5da5Sopenharmony_ci { \ 131fd4e5da5Sopenharmony_ci SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), CapabilitySet { \ 132fd4e5da5Sopenharmony_ci spv::Capability::CAP1, spv::Capability::CAP2, spv::Capability::CAP3, \ 133fd4e5da5Sopenharmony_ci spv::Capability::CAP4, spv::Capability::CAP5, spv::Capability::CAP6 \ 134fd4e5da5Sopenharmony_ci } \ 135fd4e5da5Sopenharmony_ci } 136fd4e5da5Sopenharmony_ci 137fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.3 Execution Model 138fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 139fd4e5da5Sopenharmony_ci ExecutionModel, EnumCapabilityTest, 140fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 141fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 142fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODEL, ExecutionModel::Vertex, Shader), 143fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODEL, ExecutionModel::TessellationControl, 144fd4e5da5Sopenharmony_ci Tessellation), 145fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODEL, ExecutionModel::TessellationEvaluation, 146fd4e5da5Sopenharmony_ci Tessellation), 147fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODEL, ExecutionModel::Geometry, Geometry), 148fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODEL, ExecutionModel::Fragment, Shader), 149fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODEL, ExecutionModel::GLCompute, Shader), 150fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODEL, ExecutionModel::Kernel, Kernel), 151fd4e5da5Sopenharmony_ci }))); 152fd4e5da5Sopenharmony_ci 153fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.4 Addressing Model 154fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 155fd4e5da5Sopenharmony_ci AddressingModel, EnumCapabilityTest, 156fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 157fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 158fd4e5da5Sopenharmony_ci CASE0(ADDRESSING_MODEL, AddressingModel::Logical), 159fd4e5da5Sopenharmony_ci CASE1(ADDRESSING_MODEL, AddressingModel::Physical32, Addresses), 160fd4e5da5Sopenharmony_ci CASE1(ADDRESSING_MODEL, AddressingModel::Physical64, Addresses), 161fd4e5da5Sopenharmony_ci }))); 162fd4e5da5Sopenharmony_ci 163fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.5 Memory Model 164fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 165fd4e5da5Sopenharmony_ci MemoryModel, EnumCapabilityTest, 166fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 167fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 168fd4e5da5Sopenharmony_ci CASE1(MEMORY_MODEL, MemoryModel::Simple, Shader), 169fd4e5da5Sopenharmony_ci CASE1(MEMORY_MODEL, MemoryModel::GLSL450, Shader), 170fd4e5da5Sopenharmony_ci CASE1(MEMORY_MODEL, MemoryModel::OpenCL, Kernel), 171fd4e5da5Sopenharmony_ci }))); 172fd4e5da5Sopenharmony_ci 173fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.6 Execution Mode 174fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 175fd4e5da5Sopenharmony_ci ExecutionMode, EnumCapabilityTest, 176fd4e5da5Sopenharmony_ci Combine( 177fd4e5da5Sopenharmony_ci Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 178fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 179fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::Invocations, Geometry), 180fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::SpacingEqual, Tessellation), 181fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::SpacingFractionalEven, 182fd4e5da5Sopenharmony_ci Tessellation), 183fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::SpacingFractionalOdd, 184fd4e5da5Sopenharmony_ci Tessellation), 185fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::VertexOrderCw, Tessellation), 186fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::VertexOrderCcw, Tessellation), 187fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::PixelCenterInteger, Shader), 188fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::OriginUpperLeft, Shader), 189fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::OriginLowerLeft, Shader), 190fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::EarlyFragmentTests, Shader), 191fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::PointMode, Tessellation), 192fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::Xfb, TransformFeedback), 193fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::DepthReplacing, Shader), 194fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::DepthGreater, Shader), 195fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::DepthLess, Shader), 196fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::DepthUnchanged, Shader), 197fd4e5da5Sopenharmony_ci CASE0(EXECUTION_MODE, ExecutionMode::LocalSize), 198fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::LocalSizeHint, Kernel), 199fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::InputPoints, Geometry), 200fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::InputLines, Geometry), 201fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::InputLinesAdjacency, Geometry), 202fd4e5da5Sopenharmony_ci CASE2(EXECUTION_MODE, ExecutionMode::Triangles, Geometry, 203fd4e5da5Sopenharmony_ci Tessellation), 204fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::InputTrianglesAdjacency, 205fd4e5da5Sopenharmony_ci Geometry), 206fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::Quads, Tessellation), 207fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::Isolines, Tessellation), 208fd4e5da5Sopenharmony_ci CASE4(EXECUTION_MODE, ExecutionMode::OutputVertices, Geometry, 209fd4e5da5Sopenharmony_ci Tessellation, MeshShadingNV, MeshShadingEXT), 210fd4e5da5Sopenharmony_ci CASE3(EXECUTION_MODE, ExecutionMode::OutputPoints, Geometry, 211fd4e5da5Sopenharmony_ci MeshShadingNV, MeshShadingEXT), 212fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::OutputLineStrip, Geometry), 213fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::OutputTriangleStrip, Geometry), 214fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::VecTypeHint, Kernel), 215fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::ContractionOff, Kernel), 216fd4e5da5Sopenharmony_ci }))); 217fd4e5da5Sopenharmony_ci 218fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 219fd4e5da5Sopenharmony_ci ExecutionModeV11, EnumCapabilityTest, 220fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_1), 221fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 222fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::Initializer, Kernel), 223fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::Finalizer, Kernel), 224fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::SubgroupSize, 225fd4e5da5Sopenharmony_ci SubgroupDispatch), 226fd4e5da5Sopenharmony_ci CASE1(EXECUTION_MODE, ExecutionMode::SubgroupsPerWorkgroup, 227fd4e5da5Sopenharmony_ci SubgroupDispatch)}))); 228fd4e5da5Sopenharmony_ci 229fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.7 Storage Class 230fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 231fd4e5da5Sopenharmony_ci StorageClass, EnumCapabilityTest, 232fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 233fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 234fd4e5da5Sopenharmony_ci CASE0(STORAGE_CLASS, StorageClass::UniformConstant), 235fd4e5da5Sopenharmony_ci CASE1(STORAGE_CLASS, StorageClass::Uniform, Shader), 236fd4e5da5Sopenharmony_ci CASE1(STORAGE_CLASS, StorageClass::Output, Shader), 237fd4e5da5Sopenharmony_ci CASE0(STORAGE_CLASS, StorageClass::Workgroup), 238fd4e5da5Sopenharmony_ci CASE0(STORAGE_CLASS, StorageClass::CrossWorkgroup), 239fd4e5da5Sopenharmony_ci CASE2(STORAGE_CLASS, StorageClass::Private, Shader, 240fd4e5da5Sopenharmony_ci VectorComputeINTEL), 241fd4e5da5Sopenharmony_ci CASE0(STORAGE_CLASS, StorageClass::Function), 242fd4e5da5Sopenharmony_ci CASE1(STORAGE_CLASS, StorageClass::Generic, 243fd4e5da5Sopenharmony_ci GenericPointer), // Bug 14287 244fd4e5da5Sopenharmony_ci CASE1(STORAGE_CLASS, StorageClass::PushConstant, Shader), 245fd4e5da5Sopenharmony_ci CASE1(STORAGE_CLASS, StorageClass::AtomicCounter, 246fd4e5da5Sopenharmony_ci AtomicStorage), 247fd4e5da5Sopenharmony_ci CASE0(STORAGE_CLASS, StorageClass::Image), 248fd4e5da5Sopenharmony_ci }))); 249fd4e5da5Sopenharmony_ci 250fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.8 Dim 251fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 252fd4e5da5Sopenharmony_ci Dim, EnumCapabilityTest, 253fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 254fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 255fd4e5da5Sopenharmony_ci CASE1(DIMENSIONALITY, Dim::Dim1D, Sampled1D), 256fd4e5da5Sopenharmony_ci CASE0(DIMENSIONALITY, Dim::Dim2D), 257fd4e5da5Sopenharmony_ci CASE0(DIMENSIONALITY, Dim::Dim3D), 258fd4e5da5Sopenharmony_ci CASE1(DIMENSIONALITY, Dim::Cube, Shader), 259fd4e5da5Sopenharmony_ci CASE1(DIMENSIONALITY, Dim::Rect, SampledRect), 260fd4e5da5Sopenharmony_ci CASE1(DIMENSIONALITY, Dim::Buffer, SampledBuffer), 261fd4e5da5Sopenharmony_ci CASE1(DIMENSIONALITY, Dim::SubpassData, InputAttachment), 262fd4e5da5Sopenharmony_ci }))); 263fd4e5da5Sopenharmony_ci 264fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.9 Sampler Addressing Mode 265fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 266fd4e5da5Sopenharmony_ci SamplerAddressingMode, EnumCapabilityTest, 267fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 268fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 269fd4e5da5Sopenharmony_ci CASE0(SAMPLER_ADDRESSING_MODE, SamplerAddressingMode::None), 270fd4e5da5Sopenharmony_ci CASE0(SAMPLER_ADDRESSING_MODE, 271fd4e5da5Sopenharmony_ci SamplerAddressingMode::ClampToEdge), 272fd4e5da5Sopenharmony_ci CASE0(SAMPLER_ADDRESSING_MODE, SamplerAddressingMode::Clamp), 273fd4e5da5Sopenharmony_ci CASE0(SAMPLER_ADDRESSING_MODE, SamplerAddressingMode::Repeat), 274fd4e5da5Sopenharmony_ci CASE0(SAMPLER_ADDRESSING_MODE, 275fd4e5da5Sopenharmony_ci SamplerAddressingMode::RepeatMirrored)}))); 276fd4e5da5Sopenharmony_ci 277fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.10 Sampler Filter Mode 278fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 279fd4e5da5Sopenharmony_ci SamplerFilterMode, EnumCapabilityTest, 280fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 281fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 282fd4e5da5Sopenharmony_ci CASE0(SAMPLER_FILTER_MODE, SamplerFilterMode::Nearest), 283fd4e5da5Sopenharmony_ci CASE0(SAMPLER_FILTER_MODE, SamplerFilterMode::Linear), 284fd4e5da5Sopenharmony_ci }))); 285fd4e5da5Sopenharmony_ci 286fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.11 Image Format 287fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 288fd4e5da5Sopenharmony_ci ImageFormat, EnumCapabilityTest, 289fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 290fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 291fd4e5da5Sopenharmony_ci // clang-format off 292fd4e5da5Sopenharmony_ci CASE0(SAMPLER_IMAGE_FORMAT, ImageFormat::Unknown), 293fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba32f, Shader), 294fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba16f, Shader), 295fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R32f, Shader), 296fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba8, Shader), 297fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba8Snorm, Shader), 298fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg32f, StorageImageExtendedFormats), 299fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg16f, StorageImageExtendedFormats), 300fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R11fG11fB10f, StorageImageExtendedFormats), 301fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R16f, StorageImageExtendedFormats), 302fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba16, StorageImageExtendedFormats), 303fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgb10A2, StorageImageExtendedFormats), 304fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg16, StorageImageExtendedFormats), 305fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg8, StorageImageExtendedFormats), 306fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R16, StorageImageExtendedFormats), 307fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R8, StorageImageExtendedFormats), 308fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba16Snorm, StorageImageExtendedFormats), 309fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg16Snorm, StorageImageExtendedFormats), 310fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg8Snorm, StorageImageExtendedFormats), 311fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R16Snorm, StorageImageExtendedFormats), 312fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R8Snorm, StorageImageExtendedFormats), 313fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba32i, Shader), 314fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba16i, Shader), 315fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba8i, Shader), 316fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R32i, Shader), 317fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg32i, StorageImageExtendedFormats), 318fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg16i, StorageImageExtendedFormats), 319fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg8i, StorageImageExtendedFormats), 320fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R16i, StorageImageExtendedFormats), 321fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R8i, StorageImageExtendedFormats), 322fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba32ui, Shader), 323fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba16ui, Shader), 324fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba8ui, Shader), 325fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgba8ui, Shader), 326fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rgb10a2ui, StorageImageExtendedFormats), 327fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg32ui, StorageImageExtendedFormats), 328fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg16ui, StorageImageExtendedFormats), 329fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::Rg8ui, StorageImageExtendedFormats), 330fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R16ui, StorageImageExtendedFormats), 331fd4e5da5Sopenharmony_ci CASE1(SAMPLER_IMAGE_FORMAT, ImageFormat::R8ui, StorageImageExtendedFormats), 332fd4e5da5Sopenharmony_ci // clang-format on 333fd4e5da5Sopenharmony_ci }))); 334fd4e5da5Sopenharmony_ci 335fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.12 Image Channel Order 336fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 337fd4e5da5Sopenharmony_ci ImageChannelOrder, EnumCapabilityTest, 338fd4e5da5Sopenharmony_ci Combine( 339fd4e5da5Sopenharmony_ci Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 340fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 341fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::R, Kernel), 342fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::A, Kernel), 343fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::RG, Kernel), 344fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::RA, Kernel), 345fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::RGB, Kernel), 346fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::RGBA, Kernel), 347fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::BGRA, Kernel), 348fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::ARGB, Kernel), 349fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::Intensity, Kernel), 350fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::Luminance, Kernel), 351fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::Rx, Kernel), 352fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::RGx, Kernel), 353fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::RGBx, Kernel), 354fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::Depth, Kernel), 355fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::DepthStencil, Kernel), 356fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::sRGB, Kernel), 357fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::sRGBx, Kernel), 358fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::sRGBA, Kernel), 359fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::sBGRA, Kernel), 360fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrder::ABGR, Kernel), 361fd4e5da5Sopenharmony_ci }))); 362fd4e5da5Sopenharmony_ci 363fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.13 Image Channel Data Type 364fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 365fd4e5da5Sopenharmony_ci ImageChannelDataType, EnumCapabilityTest, 366fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 367fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 368fd4e5da5Sopenharmony_ci // clang-format off 369fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::SnormInt8, Kernel), 370fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::SnormInt16, Kernel), 371fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnormInt8, Kernel), 372fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnormInt16, Kernel), 373fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnormShort565, Kernel), 374fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnormShort555, Kernel), 375fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnormInt101010, Kernel), 376fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::SignedInt8, Kernel), 377fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::SignedInt16, Kernel), 378fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::SignedInt32, Kernel), 379fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnsignedInt8, Kernel), 380fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnsignedInt16, Kernel), 381fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnsignedInt32, Kernel), 382fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::HalfFloat, Kernel), 383fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::Float, Kernel), 384fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnormInt24, Kernel), 385fd4e5da5Sopenharmony_ci CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataType::UnormInt101010_2, Kernel), 386fd4e5da5Sopenharmony_ci // clang-format on 387fd4e5da5Sopenharmony_ci }))); 388fd4e5da5Sopenharmony_ci 389fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.14 Image Operands 390fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 391fd4e5da5Sopenharmony_ci ImageOperands, EnumCapabilityTest, 392fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 393fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 394fd4e5da5Sopenharmony_ci // clang-format off 395fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_IMAGE, ImageOperandsMask::MaskNone), 396fd4e5da5Sopenharmony_ci CASE1(OPTIONAL_IMAGE, ImageOperandsMask::Bias, Shader), 397fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_IMAGE, ImageOperandsMask::Lod), 398fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_IMAGE, ImageOperandsMask::Grad), 399fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_IMAGE, ImageOperandsMask::ConstOffset), 400fd4e5da5Sopenharmony_ci CASE1(OPTIONAL_IMAGE, ImageOperandsMask::Offset, ImageGatherExtended), 401fd4e5da5Sopenharmony_ci CASE1(OPTIONAL_IMAGE, ImageOperandsMask::ConstOffsets, ImageGatherExtended), 402fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_IMAGE, ImageOperandsMask::Sample), 403fd4e5da5Sopenharmony_ci CASE1(OPTIONAL_IMAGE, ImageOperandsMask::MinLod, MinLod), 404fd4e5da5Sopenharmony_ci // clang-format on 405fd4e5da5Sopenharmony_ci }))); 406fd4e5da5Sopenharmony_ci 407fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.17 Linkage Type 408fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 409fd4e5da5Sopenharmony_ci LinkageType, EnumCapabilityTest, 410fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 411fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 412fd4e5da5Sopenharmony_ci CASE1(LINKAGE_TYPE, LinkageType::Export, Linkage), 413fd4e5da5Sopenharmony_ci CASE1(LINKAGE_TYPE, LinkageType::Import, Linkage), 414fd4e5da5Sopenharmony_ci }))); 415fd4e5da5Sopenharmony_ci 416fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.18 Access Qualifier 417fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 418fd4e5da5Sopenharmony_ci AccessQualifier, EnumCapabilityTest, 419fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 420fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 421fd4e5da5Sopenharmony_ci CASE1(ACCESS_QUALIFIER, AccessQualifier::ReadOnly, Kernel), 422fd4e5da5Sopenharmony_ci CASE1(ACCESS_QUALIFIER, AccessQualifier::WriteOnly, Kernel), 423fd4e5da5Sopenharmony_ci CASE1(ACCESS_QUALIFIER, AccessQualifier::ReadWrite, Kernel), 424fd4e5da5Sopenharmony_ci }))); 425fd4e5da5Sopenharmony_ci 426fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.19 Function Parameter Attribute 427fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 428fd4e5da5Sopenharmony_ci FunctionParameterAttribute, EnumCapabilityTest, 429fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 430fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 431fd4e5da5Sopenharmony_ci // clang-format off 432fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::Zext, Kernel), 433fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::Sext, Kernel), 434fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::ByVal, Kernel), 435fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::Sret, Kernel), 436fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::NoAlias, Kernel), 437fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::NoCapture, Kernel), 438fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::NoWrite, Kernel), 439fd4e5da5Sopenharmony_ci CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttribute::NoReadWrite, Kernel), 440fd4e5da5Sopenharmony_ci // clang-format on 441fd4e5da5Sopenharmony_ci }))); 442fd4e5da5Sopenharmony_ci 443fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.20 Decoration 444fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 445fd4e5da5Sopenharmony_ci Decoration_1_1, EnumCapabilityTest, 446fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 447fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 448fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::RelaxedPrecision, Shader), 449fd4e5da5Sopenharmony_ci // DecorationSpecId handled below. 450fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Block, Shader), 451fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::BufferBlock, Shader), 452fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::RowMajor, Matrix), 453fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::ColMajor, Matrix), 454fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::ArrayStride, Shader), 455fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::MatrixStride, 456fd4e5da5Sopenharmony_ci Matrix), // Bug 15234 457fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::GLSLShared, Shader), 458fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::GLSLPacked, Shader), 459fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::CPacked, Kernel), 460fd4e5da5Sopenharmony_ci CASE0(DECORATION, Decoration::BuiltIn), // Bug 15248 461fd4e5da5Sopenharmony_ci // Value 12 placeholder 462fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::NoPerspective, Shader), 463fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Flat, Shader), 464fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Patch, Tessellation), 465fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Centroid, Shader), 466fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Sample, 467fd4e5da5Sopenharmony_ci SampleRateShading), // Bug 15234 468fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Invariant, Shader), 469fd4e5da5Sopenharmony_ci CASE0(DECORATION, Decoration::Restrict), 470fd4e5da5Sopenharmony_ci CASE0(DECORATION, Decoration::Aliased), 471fd4e5da5Sopenharmony_ci CASE0(DECORATION, Decoration::Volatile), 472fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Constant, Kernel), 473fd4e5da5Sopenharmony_ci CASE0(DECORATION, Decoration::Coherent), 474fd4e5da5Sopenharmony_ci CASE0(DECORATION, Decoration::NonWritable), 475fd4e5da5Sopenharmony_ci CASE0(DECORATION, Decoration::NonReadable), 476fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Uniform, Shader), 477fd4e5da5Sopenharmony_ci // Value 27 is an intentional gap in the spec numbering. 478fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::SaturatedConversion, Kernel), 479fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Stream, GeometryStreams), 480fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Location, Shader), 481fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Component, Shader), 482fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Index, Shader), 483fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Binding, Shader), 484fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::DescriptorSet, Shader), 485fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Offset, Shader), // Bug 15268 486fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::XfbBuffer, TransformFeedback), 487fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::XfbStride, TransformFeedback), 488fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::FuncParamAttr, Kernel), 489fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::FPFastMathMode, Kernel), 490fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::LinkageAttributes, Linkage), 491fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::NoContraction, Shader), 492fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::InputAttachmentIndex, 493fd4e5da5Sopenharmony_ci InputAttachment), 494fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::Alignment, Kernel), 495fd4e5da5Sopenharmony_ci }))); 496fd4e5da5Sopenharmony_ci 497fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.20 Decoration 498fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(Decoration_1_6, EnumCapabilityTest, 499fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_6), 500fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 501fd4e5da5Sopenharmony_ci CASE2(DECORATION, Decoration::Uniform, 502fd4e5da5Sopenharmony_ci Shader, UniformDecoration)}))); 503fd4e5da5Sopenharmony_ci 504fd4e5da5Sopenharmony_ci#if 0 505fd4e5da5Sopenharmony_ci// SpecId has different requirements in v1.0 and v1.1: 506fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(DecorationSpecIdV10, EnumCapabilityTest, 507fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0), 508fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{CASE1( 509fd4e5da5Sopenharmony_ci DECORATION, DecorationSpecId, Shader)}))); 510fd4e5da5Sopenharmony_ci#endif 511fd4e5da5Sopenharmony_ci 512fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 513fd4e5da5Sopenharmony_ci DecorationV11, EnumCapabilityTest, 514fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_1), 515fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 516fd4e5da5Sopenharmony_ci CASE2(DECORATION, Decoration::SpecId, Shader, Kernel), 517fd4e5da5Sopenharmony_ci CASE1(DECORATION, Decoration::MaxByteOffset, Addresses)}))); 518fd4e5da5Sopenharmony_ci 519fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.21 BuiltIn 520fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 521fd4e5da5Sopenharmony_ci BuiltIn, EnumCapabilityTest, 522fd4e5da5Sopenharmony_ci Combine( 523fd4e5da5Sopenharmony_ci Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 524fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 525fd4e5da5Sopenharmony_ci // clang-format off 526fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::Position, Shader), 527fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::PointSize, Shader), 528fd4e5da5Sopenharmony_ci // 2 is an intentional gap in the spec numbering. 529fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::ClipDistance, ClipDistance), // Bug 1407, 15234 530fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::CullDistance, CullDistance), // Bug 1407, 15234 531fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::VertexId, Shader), 532fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::InstanceId, Shader), 533fd4e5da5Sopenharmony_ci CASE6(BUILT_IN, BuiltIn::PrimitiveId, Geometry, Tessellation, 534fd4e5da5Sopenharmony_ci RayTracingNV, RayTracingKHR, MeshShadingNV, MeshShadingEXT), 535fd4e5da5Sopenharmony_ci CASE2(BUILT_IN, BuiltIn::InvocationId, Geometry, Tessellation), 536fd4e5da5Sopenharmony_ci CASE4(BUILT_IN, BuiltIn::Layer, Geometry, ShaderViewportIndexLayerEXT, MeshShadingNV, MeshShadingEXT), 537fd4e5da5Sopenharmony_ci CASE4(BUILT_IN, BuiltIn::ViewportIndex, MultiViewport, ShaderViewportIndexLayerEXT, MeshShadingNV, MeshShadingEXT), // Bug 15234 538fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::TessLevelOuter, Tessellation), 539fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::TessLevelInner, Tessellation), 540fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::TessCoord, Tessellation), 541fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::PatchVertices, Tessellation), 542fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::FragCoord, Shader), 543fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::PointCoord, Shader), 544fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::FrontFacing, Shader), 545fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::SampleId, SampleRateShading), // Bug 15234 546fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::SamplePosition, SampleRateShading), // Bug 15234 547fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::SampleMask, Shader), // Bug 15234, Issue 182 548fd4e5da5Sopenharmony_ci // Value 21 intentionally missing 549fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::FragDepth, Shader), 550fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::HelperInvocation, Shader), 551fd4e5da5Sopenharmony_ci CASE0(BUILT_IN, BuiltIn::NumWorkgroups), 552fd4e5da5Sopenharmony_ci CASE0(BUILT_IN, BuiltIn::WorkgroupSize), 553fd4e5da5Sopenharmony_ci CASE0(BUILT_IN, BuiltIn::WorkgroupId), 554fd4e5da5Sopenharmony_ci CASE0(BUILT_IN, BuiltIn::LocalInvocationId), 555fd4e5da5Sopenharmony_ci CASE0(BUILT_IN, BuiltIn::GlobalInvocationId), 556fd4e5da5Sopenharmony_ci CASE0(BUILT_IN, BuiltIn::LocalInvocationIndex), 557fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::WorkDim, Kernel), 558fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::GlobalSize, Kernel), 559fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::EnqueuedWorkgroupSize, Kernel), 560fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::GlobalOffset, Kernel), 561fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::GlobalLinearId, Kernel), 562fd4e5da5Sopenharmony_ci // Value 35 intentionally missing 563fd4e5da5Sopenharmony_ci CASE2(BUILT_IN, BuiltIn::SubgroupSize, Kernel, SubgroupBallotKHR), 564fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::SubgroupMaxSize, Kernel), 565fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::NumSubgroups, Kernel), 566fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::NumEnqueuedSubgroups, Kernel), 567fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::SubgroupId, Kernel), 568fd4e5da5Sopenharmony_ci CASE2(BUILT_IN, BuiltIn::SubgroupLocalInvocationId, Kernel, SubgroupBallotKHR), 569fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::VertexIndex, Shader), 570fd4e5da5Sopenharmony_ci CASE1(BUILT_IN, BuiltIn::InstanceIndex, Shader), 571fd4e5da5Sopenharmony_ci // clang-format on 572fd4e5da5Sopenharmony_ci }))); 573fd4e5da5Sopenharmony_ci 574fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 575fd4e5da5Sopenharmony_ci BuiltInV1_5, EnumCapabilityTest, 576fd4e5da5Sopenharmony_ci Combine( 577fd4e5da5Sopenharmony_ci Values(SPV_ENV_UNIVERSAL_1_5), 578fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 579fd4e5da5Sopenharmony_ci // SPIR-V 1.5 adds new capabilities to enable these two builtins. 580fd4e5da5Sopenharmony_ci CASE5(BUILT_IN, BuiltIn::Layer, Geometry, ShaderLayer, 581fd4e5da5Sopenharmony_ci ShaderViewportIndexLayerEXT, MeshShadingNV, MeshShadingEXT), 582fd4e5da5Sopenharmony_ci CASE5(BUILT_IN, BuiltIn::ViewportIndex, MultiViewport, 583fd4e5da5Sopenharmony_ci ShaderViewportIndex, ShaderViewportIndexLayerEXT, 584fd4e5da5Sopenharmony_ci MeshShadingNV, MeshShadingEXT), 585fd4e5da5Sopenharmony_ci }))); 586fd4e5da5Sopenharmony_ci 587fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.22 Selection Control 588fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 589fd4e5da5Sopenharmony_ci SelectionControl, EnumCapabilityTest, 590fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 591fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 592fd4e5da5Sopenharmony_ci CASE0(SELECTION_CONTROL, SelectionControlMask::MaskNone), 593fd4e5da5Sopenharmony_ci CASE0(SELECTION_CONTROL, SelectionControlMask::Flatten), 594fd4e5da5Sopenharmony_ci CASE0(SELECTION_CONTROL, SelectionControlMask::DontFlatten), 595fd4e5da5Sopenharmony_ci }))); 596fd4e5da5Sopenharmony_ci 597fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.23 Loop Control 598fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 599fd4e5da5Sopenharmony_ci LoopControl, EnumCapabilityTest, 600fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 601fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 602fd4e5da5Sopenharmony_ci CASE0(LOOP_CONTROL, LoopControlMask::MaskNone), 603fd4e5da5Sopenharmony_ci CASE0(LOOP_CONTROL, LoopControlMask::Unroll), 604fd4e5da5Sopenharmony_ci CASE0(LOOP_CONTROL, LoopControlMask::DontUnroll), 605fd4e5da5Sopenharmony_ci }))); 606fd4e5da5Sopenharmony_ci 607fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 608fd4e5da5Sopenharmony_ci LoopControlV11, EnumCapabilityTest, 609fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_1), 610fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 611fd4e5da5Sopenharmony_ci CASE0(LOOP_CONTROL, LoopControlMask::DependencyInfinite), 612fd4e5da5Sopenharmony_ci CASE0(LOOP_CONTROL, LoopControlMask::DependencyLength), 613fd4e5da5Sopenharmony_ci }))); 614fd4e5da5Sopenharmony_ci 615fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.24 Function Control 616fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 617fd4e5da5Sopenharmony_ci FunctionControl, EnumCapabilityTest, 618fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 619fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 620fd4e5da5Sopenharmony_ci CASE0(FUNCTION_CONTROL, FunctionControlMask::MaskNone), 621fd4e5da5Sopenharmony_ci CASE0(FUNCTION_CONTROL, FunctionControlMask::Inline), 622fd4e5da5Sopenharmony_ci CASE0(FUNCTION_CONTROL, FunctionControlMask::DontInline), 623fd4e5da5Sopenharmony_ci CASE0(FUNCTION_CONTROL, FunctionControlMask::Pure), 624fd4e5da5Sopenharmony_ci CASE0(FUNCTION_CONTROL, FunctionControlMask::Const), 625fd4e5da5Sopenharmony_ci }))); 626fd4e5da5Sopenharmony_ci 627fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.25 Memory Semantics <id> 628fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 629fd4e5da5Sopenharmony_ci MemorySemantics, EnumCapabilityTest, 630fd4e5da5Sopenharmony_ci Combine( 631fd4e5da5Sopenharmony_ci Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 632fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 633fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMask::MaskNone), 634fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMask::Acquire), 635fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMask::Release), 636fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMask::AcquireRelease), 637fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, 638fd4e5da5Sopenharmony_ci MemorySemanticsMask::SequentiallyConsistent), 639fd4e5da5Sopenharmony_ci CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsMask::UniformMemory, 640fd4e5da5Sopenharmony_ci Shader), 641fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMask::SubgroupMemory), 642fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMask::WorkgroupMemory), 643fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, 644fd4e5da5Sopenharmony_ci MemorySemanticsMask::CrossWorkgroupMemory), 645fd4e5da5Sopenharmony_ci CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsMask::AtomicCounterMemory, 646fd4e5da5Sopenharmony_ci AtomicStorage), // Bug 15234 647fd4e5da5Sopenharmony_ci CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMask::ImageMemory), 648fd4e5da5Sopenharmony_ci }))); 649fd4e5da5Sopenharmony_ci 650fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.26 Memory Access 651fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 652fd4e5da5Sopenharmony_ci MemoryAccess, EnumCapabilityTest, 653fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 654fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 655fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMask::MaskNone), 656fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMask::Volatile), 657fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMask::Aligned), 658fd4e5da5Sopenharmony_ci CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMask::Nontemporal), 659fd4e5da5Sopenharmony_ci }))); 660fd4e5da5Sopenharmony_ci 661fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.27 Scope <id> 662fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 663fd4e5da5Sopenharmony_ci Scope, EnumCapabilityTest, 664fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, 665fd4e5da5Sopenharmony_ci SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), 666fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 667fd4e5da5Sopenharmony_ci CASE0(SCOPE_ID, Scope::CrossDevice), 668fd4e5da5Sopenharmony_ci CASE0(SCOPE_ID, Scope::Device), 669fd4e5da5Sopenharmony_ci CASE0(SCOPE_ID, Scope::Workgroup), 670fd4e5da5Sopenharmony_ci CASE0(SCOPE_ID, Scope::Subgroup), 671fd4e5da5Sopenharmony_ci CASE0(SCOPE_ID, Scope::Invocation), 672fd4e5da5Sopenharmony_ci CASE1(SCOPE_ID, Scope::QueueFamilyKHR, VulkanMemoryModelKHR), 673fd4e5da5Sopenharmony_ci }))); 674fd4e5da5Sopenharmony_ci 675fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.28 Group Operation 676fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 677fd4e5da5Sopenharmony_ci GroupOperation, EnumCapabilityTest, 678fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 679fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 680fd4e5da5Sopenharmony_ci CASE3(GROUP_OPERATION, GroupOperation::Reduce, Kernel, 681fd4e5da5Sopenharmony_ci GroupNonUniformArithmetic, GroupNonUniformBallot), 682fd4e5da5Sopenharmony_ci CASE3(GROUP_OPERATION, GroupOperation::InclusiveScan, Kernel, 683fd4e5da5Sopenharmony_ci GroupNonUniformArithmetic, GroupNonUniformBallot), 684fd4e5da5Sopenharmony_ci CASE3(GROUP_OPERATION, GroupOperation::ExclusiveScan, Kernel, 685fd4e5da5Sopenharmony_ci GroupNonUniformArithmetic, GroupNonUniformBallot), 686fd4e5da5Sopenharmony_ci }))); 687fd4e5da5Sopenharmony_ci 688fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.29 Kernel Enqueue Flags 689fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 690fd4e5da5Sopenharmony_ci KernelEnqueueFlags, EnumCapabilityTest, 691fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 692fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 693fd4e5da5Sopenharmony_ci CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlags::NoWait, Kernel), 694fd4e5da5Sopenharmony_ci CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlags::WaitKernel, Kernel), 695fd4e5da5Sopenharmony_ci CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlags::WaitWorkGroup, 696fd4e5da5Sopenharmony_ci Kernel), 697fd4e5da5Sopenharmony_ci }))); 698fd4e5da5Sopenharmony_ci 699fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.30 Kernel Profiling Info 700fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 701fd4e5da5Sopenharmony_ci KernelProfilingInfo, EnumCapabilityTest, 702fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 703fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 704fd4e5da5Sopenharmony_ci CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMask::MaskNone), 705fd4e5da5Sopenharmony_ci CASE1(KERNEL_PROFILING_INFO, 706fd4e5da5Sopenharmony_ci KernelProfilingInfoMask::CmdExecTime, Kernel), 707fd4e5da5Sopenharmony_ci }))); 708fd4e5da5Sopenharmony_ci 709fd4e5da5Sopenharmony_ci// See SPIR-V Section 3.31 Capability 710fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 711fd4e5da5Sopenharmony_ci CapabilityDependsOn, EnumCapabilityTest, 712fd4e5da5Sopenharmony_ci Combine( 713fd4e5da5Sopenharmony_ci Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 714fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 715fd4e5da5Sopenharmony_ci // clang-format off 716fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Matrix), 717fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Shader, Matrix), 718fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Geometry, Shader), 719fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Tessellation, Shader), 720fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Addresses), 721fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Linkage), 722fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Kernel), 723fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Vector16, Kernel), 724fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Float16Buffer, Kernel), 725fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Float16), // Bug 15234 726fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Float64), 727fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Int64), 728fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Int64Atomics, Int64), 729fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageBasic, Kernel), 730fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageReadWrite, ImageBasic), 731fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageMipmap, ImageBasic), 732fd4e5da5Sopenharmony_ci // Value 16 intentionally missing. 733fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Pipes, Kernel), 734fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Groups), 735fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::DeviceEnqueue, Kernel), 736fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::LiteralSampler, Kernel), 737fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::AtomicStorage, Shader), 738fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Int16), 739fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::TessellationPointSize, Tessellation), 740fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::GeometryPointSize, Geometry), 741fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageGatherExtended, Shader), 742fd4e5da5Sopenharmony_ci // Value 26 intentionally missing. 743fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::StorageImageMultisample, Shader), 744fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::UniformBufferArrayDynamicIndexing, Shader), 745fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::SampledImageArrayDynamicIndexing, Shader), 746fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::StorageBufferArrayDynamicIndexing, Shader), 747fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::StorageImageArrayDynamicIndexing, Shader), 748fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ClipDistance, Shader), 749fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::CullDistance, Shader), 750fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageCubeArray, SampledCubeArray), 751fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::SampleRateShading, Shader), 752fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageRect, SampledRect), 753fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::SampledRect, Shader), 754fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::GenericPointer, Addresses), 755fd4e5da5Sopenharmony_ci CASE0(CAPABILITY, Capability::Int8), 756fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::InputAttachment, Shader), 757fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::SparseResidency, Shader), 758fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::MinLod, Shader), 759fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::Image1D, Sampled1D), 760fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::SampledCubeArray, Shader), 761fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageBuffer, SampledBuffer), 762fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageMSArray, Shader), 763fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::StorageImageExtendedFormats, Shader), 764fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::ImageQuery, Shader), 765fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::DerivativeControl, Shader), 766fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::InterpolationFunction, Shader), 767fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::TransformFeedback, Shader), 768fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::GeometryStreams, Geometry), 769fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::StorageImageReadWithoutFormat, Shader), 770fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::StorageImageWriteWithoutFormat, Shader), 771fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::MultiViewport, Geometry), 772fd4e5da5Sopenharmony_ci // clang-format on 773fd4e5da5Sopenharmony_ci }))); 774fd4e5da5Sopenharmony_ci 775fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P( 776fd4e5da5Sopenharmony_ci CapabilityDependsOnV11, EnumCapabilityTest, 777fd4e5da5Sopenharmony_ci Combine(Values(SPV_ENV_UNIVERSAL_1_1), 778fd4e5da5Sopenharmony_ci ValuesIn(std::vector<EnumCapabilityCase>{ 779fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::SubgroupDispatch, DeviceEnqueue), 780fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::NamedBarrier, Kernel), 781fd4e5da5Sopenharmony_ci CASE1(CAPABILITY, Capability::PipeStorage, Pipes), 782fd4e5da5Sopenharmony_ci }))); 783fd4e5da5Sopenharmony_ci 784fd4e5da5Sopenharmony_ci#undef CASE0 785fd4e5da5Sopenharmony_ci#undef CASE1 786fd4e5da5Sopenharmony_ci#undef CASE2 787fd4e5da5Sopenharmony_ci 788fd4e5da5Sopenharmony_ci} // namespace 789fd4e5da5Sopenharmony_ci} // namespace spvtools 790