1 // Copyright (c) 2015-2016 The Khronos Group Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Test capability dependencies for enums. 16 17 #include <tuple> 18 #include <vector> 19 20 #include "gmock/gmock.h" 21 #include "source/enum_set.h" 22 #include "test/unit_spirv.h" 23 24 namespace spvtools { 25 namespace { 26 27 using spvtest::ElementsIn; 28 using ::testing::Combine; 29 using ::testing::Eq; 30 using ::testing::TestWithParam; 31 using ::testing::Values; 32 using ::testing::ValuesIn; 33 34 // A test case for mapping an enum to a capability mask. 35 struct EnumCapabilityCase { 36 spv_operand_type_t type; 37 uint32_t value; 38 CapabilitySet expected_capabilities; 39 }; 40 41 // Test fixture for testing EnumCapabilityCases. 42 using EnumCapabilityTest = 43 TestWithParam<std::tuple<spv_target_env, EnumCapabilityCase>>; 44 45 TEST_P(EnumCapabilityTest, Sample) { 46 const auto env = std::get<0>(GetParam()); 47 const auto context = spvContextCreate(env); 48 const AssemblyGrammar grammar(context); 49 spv_operand_desc entry; 50 51 ASSERT_EQ(SPV_SUCCESS, 52 grammar.lookupOperand(std::get<1>(GetParam()).type, 53 std::get<1>(GetParam()).value, &entry)); 54 const auto cap_set = grammar.filterCapsAgainstTargetEnv( 55 entry->capabilities, entry->numCapabilities); 56 57 EXPECT_THAT(ElementsIn(cap_set), 58 Eq(ElementsIn(std::get<1>(GetParam()).expected_capabilities))) 59 << " capability value " << std::get<1>(GetParam()).value; 60 spvContextDestroy(context); 61 } 62 63 #define CASE0(TYPE, VALUE) \ 64 { \ 65 SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), {} \ 66 } 67 #define CASE1(TYPE, VALUE, CAP) \ 68 { \ 69 SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ 70 SpvCapability##CAP \ 71 } \ 72 } 73 #define CASE2(TYPE, VALUE, CAP1, CAP2) \ 74 { \ 75 SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ 76 SpvCapability##CAP1, SpvCapability##CAP2 \ 77 } \ 78 } 79 #define CASE3(TYPE, VALUE, CAP1, CAP2, CAP3) \ 80 { \ 81 SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ 82 SpvCapability##CAP1, SpvCapability##CAP2, SpvCapability##CAP3 \ 83 } \ 84 } 85 #define CASE5(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4, CAP5) \ 86 { \ 87 SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \ 88 SpvCapability##CAP1, SpvCapability##CAP2, SpvCapability##CAP3, \ 89 SpvCapability##CAP4, SpvCapability##CAP5 \ 90 } \ 91 } 92 93 // See SPIR-V Section 3.3 Execution Model 94 INSTANTIATE_TEST_CASE_P( 95 ExecutionModel, EnumCapabilityTest, 96 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 97 ValuesIn(std::vector<EnumCapabilityCase>{ 98 CASE1(EXECUTION_MODEL, ExecutionModelVertex, Shader), 99 CASE1(EXECUTION_MODEL, ExecutionModelTessellationControl, 100 Tessellation), 101 CASE1(EXECUTION_MODEL, ExecutionModelTessellationEvaluation, 102 Tessellation), 103 CASE1(EXECUTION_MODEL, ExecutionModelGeometry, Geometry), 104 CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader), 105 CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader), 106 CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel), 107 })), ); 108 109 // See SPIR-V Section 3.4 Addressing Model 110 INSTANTIATE_TEST_CASE_P( 111 AddressingModel, EnumCapabilityTest, 112 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 113 ValuesIn(std::vector<EnumCapabilityCase>{ 114 CASE0(ADDRESSING_MODEL, AddressingModelLogical), 115 CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses), 116 CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses), 117 })), ); 118 119 // See SPIR-V Section 3.5 Memory Model 120 INSTANTIATE_TEST_CASE_P( 121 MemoryModel, EnumCapabilityTest, 122 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 123 ValuesIn(std::vector<EnumCapabilityCase>{ 124 CASE1(MEMORY_MODEL, MemoryModelSimple, Shader), 125 CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader), 126 CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel), 127 })), ); 128 129 // See SPIR-V Section 3.6 Execution Mode 130 INSTANTIATE_TEST_CASE_P( 131 ExecutionMode, EnumCapabilityTest, 132 Combine( 133 Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 134 ValuesIn(std::vector<EnumCapabilityCase>{ 135 CASE1(EXECUTION_MODE, ExecutionModeInvocations, Geometry), 136 CASE1(EXECUTION_MODE, ExecutionModeSpacingEqual, Tessellation), 137 CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalEven, 138 Tessellation), 139 CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalOdd, 140 Tessellation), 141 CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCw, Tessellation), 142 CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCcw, Tessellation), 143 CASE1(EXECUTION_MODE, ExecutionModePixelCenterInteger, Shader), 144 CASE1(EXECUTION_MODE, ExecutionModeOriginUpperLeft, Shader), 145 CASE1(EXECUTION_MODE, ExecutionModeOriginLowerLeft, Shader), 146 CASE1(EXECUTION_MODE, ExecutionModeEarlyFragmentTests, Shader), 147 CASE1(EXECUTION_MODE, ExecutionModePointMode, Tessellation), 148 CASE1(EXECUTION_MODE, ExecutionModeXfb, TransformFeedback), 149 CASE1(EXECUTION_MODE, ExecutionModeDepthReplacing, Shader), 150 CASE1(EXECUTION_MODE, ExecutionModeDepthGreater, Shader), 151 CASE1(EXECUTION_MODE, ExecutionModeDepthLess, Shader), 152 CASE1(EXECUTION_MODE, ExecutionModeDepthUnchanged, Shader), 153 CASE0(EXECUTION_MODE, ExecutionModeLocalSize), 154 CASE1(EXECUTION_MODE, ExecutionModeLocalSizeHint, Kernel), 155 CASE1(EXECUTION_MODE, ExecutionModeInputPoints, Geometry), 156 CASE1(EXECUTION_MODE, ExecutionModeInputLines, Geometry), 157 CASE1(EXECUTION_MODE, ExecutionModeInputLinesAdjacency, Geometry), 158 CASE2(EXECUTION_MODE, ExecutionModeTriangles, Geometry, 159 Tessellation), 160 CASE1(EXECUTION_MODE, ExecutionModeInputTrianglesAdjacency, 161 Geometry), 162 CASE1(EXECUTION_MODE, ExecutionModeQuads, Tessellation), 163 CASE1(EXECUTION_MODE, ExecutionModeIsolines, Tessellation), 164 CASE3(EXECUTION_MODE, ExecutionModeOutputVertices, Geometry, 165 Tessellation, MeshShadingNV), 166 CASE2(EXECUTION_MODE, ExecutionModeOutputPoints, Geometry, 167 MeshShadingNV), 168 CASE1(EXECUTION_MODE, ExecutionModeOutputLineStrip, Geometry), 169 CASE1(EXECUTION_MODE, ExecutionModeOutputTriangleStrip, Geometry), 170 CASE1(EXECUTION_MODE, ExecutionModeVecTypeHint, Kernel), 171 CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel), 172 })), ); 173 174 INSTANTIATE_TEST_CASE_P( 175 ExecutionModeV11, EnumCapabilityTest, 176 Combine(Values(SPV_ENV_UNIVERSAL_1_1), 177 ValuesIn(std::vector<EnumCapabilityCase>{ 178 CASE1(EXECUTION_MODE, ExecutionModeInitializer, Kernel), 179 CASE1(EXECUTION_MODE, ExecutionModeFinalizer, Kernel), 180 CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize, 181 SubgroupDispatch), 182 CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup, 183 SubgroupDispatch)})), ); 184 185 // See SPIR-V Section 3.7 Storage Class 186 INSTANTIATE_TEST_CASE_P( 187 StorageClass, EnumCapabilityTest, 188 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 189 ValuesIn(std::vector<EnumCapabilityCase>{ 190 CASE0(STORAGE_CLASS, StorageClassUniformConstant), 191 CASE1(STORAGE_CLASS, StorageClassUniform, Shader), 192 CASE1(STORAGE_CLASS, StorageClassOutput, Shader), 193 CASE0(STORAGE_CLASS, StorageClassWorkgroup), 194 CASE0(STORAGE_CLASS, StorageClassCrossWorkgroup), 195 CASE1(STORAGE_CLASS, StorageClassPrivate, Shader), 196 CASE0(STORAGE_CLASS, StorageClassFunction), 197 CASE1(STORAGE_CLASS, StorageClassGeneric, 198 GenericPointer), // Bug 14287 199 CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader), 200 CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage), 201 CASE0(STORAGE_CLASS, StorageClassImage), 202 })), ); 203 204 // See SPIR-V Section 3.8 Dim 205 INSTANTIATE_TEST_CASE_P( 206 Dim, EnumCapabilityTest, 207 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 208 ValuesIn(std::vector<EnumCapabilityCase>{ 209 CASE2(DIMENSIONALITY, Dim1D, Sampled1D, Image1D), 210 CASE3(DIMENSIONALITY, Dim2D, Kernel, Shader, ImageMSArray), 211 CASE0(DIMENSIONALITY, Dim3D), 212 CASE2(DIMENSIONALITY, DimCube, Shader, ImageCubeArray), 213 CASE2(DIMENSIONALITY, DimRect, SampledRect, ImageRect), 214 CASE2(DIMENSIONALITY, DimBuffer, SampledBuffer, ImageBuffer), 215 CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment), 216 })), ); 217 218 // See SPIR-V Section 3.9 Sampler Addressing Mode 219 INSTANTIATE_TEST_CASE_P( 220 SamplerAddressingMode, EnumCapabilityTest, 221 Combine( 222 Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 223 ValuesIn(std::vector<EnumCapabilityCase>{ 224 CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeNone, Kernel), 225 CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClampToEdge, 226 Kernel), 227 CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClamp, Kernel), 228 CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeat, Kernel), 229 CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeatMirrored, 230 Kernel), 231 })), ); 232 233 // See SPIR-V Section 3.10 Sampler Filter Mode 234 INSTANTIATE_TEST_CASE_P( 235 SamplerFilterMode, EnumCapabilityTest, 236 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 237 ValuesIn(std::vector<EnumCapabilityCase>{ 238 CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel), 239 CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel), 240 })), ); 241 242 // See SPIR-V Section 3.11 Image Format 243 INSTANTIATE_TEST_CASE_P( 244 ImageFormat, EnumCapabilityTest, 245 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 246 ValuesIn(std::vector<EnumCapabilityCase>{ 247 // clang-format off 248 CASE0(SAMPLER_IMAGE_FORMAT, ImageFormatUnknown), 249 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32f, Shader), 250 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16f, Shader), 251 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32f, Shader), 252 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8, Shader), 253 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8Snorm, Shader), 254 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32f, StorageImageExtendedFormats), 255 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16f, StorageImageExtendedFormats), 256 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR11fG11fB10f, StorageImageExtendedFormats), 257 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16f, StorageImageExtendedFormats), 258 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16, StorageImageExtendedFormats), 259 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10A2, StorageImageExtendedFormats), 260 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16, StorageImageExtendedFormats), 261 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8, StorageImageExtendedFormats), 262 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16, StorageImageExtendedFormats), 263 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8, StorageImageExtendedFormats), 264 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16Snorm, StorageImageExtendedFormats), 265 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16Snorm, StorageImageExtendedFormats), 266 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8Snorm, StorageImageExtendedFormats), 267 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16Snorm, StorageImageExtendedFormats), 268 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8Snorm, StorageImageExtendedFormats), 269 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32i, Shader), 270 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16i, Shader), 271 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8i, Shader), 272 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32i, Shader), 273 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32i, StorageImageExtendedFormats), 274 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16i, StorageImageExtendedFormats), 275 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8i, StorageImageExtendedFormats), 276 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16i, StorageImageExtendedFormats), 277 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8i, StorageImageExtendedFormats), 278 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32ui, Shader), 279 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16ui, Shader), 280 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader), 281 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader), 282 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10a2ui, StorageImageExtendedFormats), 283 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32ui, StorageImageExtendedFormats), 284 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16ui, StorageImageExtendedFormats), 285 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8ui, StorageImageExtendedFormats), 286 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats), 287 CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats), 288 // clang-format on 289 })), ); 290 291 // See SPIR-V Section 3.12 Image Channel Order 292 INSTANTIATE_TEST_CASE_P( 293 ImageChannelOrder, EnumCapabilityTest, 294 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 295 ValuesIn(std::vector<EnumCapabilityCase>{ 296 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderR, Kernel), 297 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderA, Kernel), 298 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRG, Kernel), 299 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRA, Kernel), 300 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGB, Kernel), 301 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBA, Kernel), 302 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderBGRA, Kernel), 303 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderARGB, Kernel), 304 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderIntensity, Kernel), 305 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderLuminance, Kernel), 306 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRx, Kernel), 307 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGx, Kernel), 308 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBx, Kernel), 309 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepth, Kernel), 310 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepthStencil, 311 Kernel), 312 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGB, Kernel), 313 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBx, Kernel), 314 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel), 315 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel), 316 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel), 317 })), ); 318 319 // See SPIR-V Section 3.13 Image Channel Data Type 320 INSTANTIATE_TEST_CASE_P( 321 ImageChannelDataType, EnumCapabilityTest, 322 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 323 ValuesIn(std::vector<EnumCapabilityCase>{ 324 // clang-format off 325 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt8, Kernel), 326 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt16, Kernel), 327 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt8, Kernel), 328 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt16, Kernel), 329 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort565, Kernel), 330 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort555, Kernel), 331 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010, Kernel), 332 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt8, Kernel), 333 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt16, Kernel), 334 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt32, Kernel), 335 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt8, Kernel), 336 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt16, Kernel), 337 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt32, Kernel), 338 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeHalfFloat, Kernel), 339 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeFloat, Kernel), 340 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel), 341 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel), 342 // clang-format on 343 })), ); 344 345 // See SPIR-V Section 3.14 Image Operands 346 INSTANTIATE_TEST_CASE_P( 347 ImageOperands, EnumCapabilityTest, 348 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 349 ValuesIn(std::vector<EnumCapabilityCase>{ 350 // clang-format off 351 CASE0(OPTIONAL_IMAGE, ImageOperandsMaskNone), 352 CASE1(OPTIONAL_IMAGE, ImageOperandsBiasMask, Shader), 353 CASE0(OPTIONAL_IMAGE, ImageOperandsLodMask), 354 CASE0(OPTIONAL_IMAGE, ImageOperandsGradMask), 355 CASE0(OPTIONAL_IMAGE, ImageOperandsConstOffsetMask), 356 CASE1(OPTIONAL_IMAGE, ImageOperandsOffsetMask, ImageGatherExtended), 357 CASE1(OPTIONAL_IMAGE, ImageOperandsConstOffsetsMask, ImageGatherExtended), 358 CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask), 359 CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod), 360 // clang-format on 361 })), ); 362 363 // See SPIR-V Section 3.15 FP Fast Math Mode 364 INSTANTIATE_TEST_CASE_P( 365 FPFastMathMode, EnumCapabilityTest, 366 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 367 ValuesIn(std::vector<EnumCapabilityCase>{ 368 CASE0(FP_FAST_MATH_MODE, FPFastMathModeMaskNone), 369 CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotNaNMask, Kernel), 370 CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotInfMask, Kernel), 371 CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel), 372 CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel), 373 CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel), 374 })), ); 375 376 // See SPIR-V Section 3.17 Linkage Type 377 INSTANTIATE_TEST_CASE_P( 378 LinkageType, EnumCapabilityTest, 379 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 380 ValuesIn(std::vector<EnumCapabilityCase>{ 381 CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage), 382 CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage), 383 })), ); 384 385 // See SPIR-V Section 3.18 Access Qualifier 386 INSTANTIATE_TEST_CASE_P( 387 AccessQualifier, EnumCapabilityTest, 388 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 389 ValuesIn(std::vector<EnumCapabilityCase>{ 390 CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel), 391 CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel), 392 CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel), 393 })), ); 394 395 // See SPIR-V Section 3.19 Function Parameter Attribute 396 INSTANTIATE_TEST_CASE_P( 397 FunctionParameterAttribute, EnumCapabilityTest, 398 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 399 ValuesIn(std::vector<EnumCapabilityCase>{ 400 // clang-format off 401 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeZext, Kernel), 402 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSext, Kernel), 403 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeByVal, Kernel), 404 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSret, Kernel), 405 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoAlias, Kernel), 406 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoCapture, Kernel), 407 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel), 408 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel), 409 // clang-format on 410 })), ); 411 412 // See SPIR-V Section 3.20 Decoration 413 INSTANTIATE_TEST_CASE_P( 414 Decoration, EnumCapabilityTest, 415 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 416 ValuesIn(std::vector<EnumCapabilityCase>{ 417 CASE1(DECORATION, DecorationRelaxedPrecision, Shader), 418 // DecorationSpecId handled below. 419 CASE1(DECORATION, DecorationBlock, Shader), 420 CASE1(DECORATION, DecorationBufferBlock, Shader), 421 CASE1(DECORATION, DecorationRowMajor, Matrix), 422 CASE1(DECORATION, DecorationColMajor, Matrix), 423 CASE1(DECORATION, DecorationArrayStride, Shader), 424 CASE1(DECORATION, DecorationMatrixStride, Matrix), // Bug 15234 425 CASE1(DECORATION, DecorationGLSLShared, Shader), 426 CASE1(DECORATION, DecorationGLSLPacked, Shader), 427 CASE1(DECORATION, DecorationCPacked, Kernel), 428 CASE0(DECORATION, DecorationBuiltIn), // Bug 15248 429 // Value 12 placeholder 430 CASE1(DECORATION, DecorationNoPerspective, Shader), 431 CASE1(DECORATION, DecorationFlat, Shader), 432 CASE1(DECORATION, DecorationPatch, Tessellation), 433 CASE1(DECORATION, DecorationCentroid, Shader), 434 CASE1(DECORATION, DecorationSample, 435 SampleRateShading), // Bug 15234 436 CASE1(DECORATION, DecorationInvariant, Shader), 437 CASE0(DECORATION, DecorationRestrict), 438 CASE0(DECORATION, DecorationAliased), 439 CASE0(DECORATION, DecorationVolatile), 440 CASE1(DECORATION, DecorationConstant, Kernel), 441 CASE0(DECORATION, DecorationCoherent), 442 CASE0(DECORATION, DecorationNonWritable), 443 CASE0(DECORATION, DecorationNonReadable), 444 CASE1(DECORATION, DecorationUniform, Shader), 445 // Value 27 is an intentional gap in the spec numbering. 446 CASE1(DECORATION, DecorationSaturatedConversion, Kernel), 447 CASE1(DECORATION, DecorationStream, GeometryStreams), 448 CASE1(DECORATION, DecorationLocation, Shader), 449 CASE1(DECORATION, DecorationComponent, Shader), 450 CASE1(DECORATION, DecorationIndex, Shader), 451 CASE1(DECORATION, DecorationBinding, Shader), 452 CASE1(DECORATION, DecorationDescriptorSet, Shader), 453 CASE1(DECORATION, DecorationOffset, Shader), // Bug 15268 454 CASE1(DECORATION, DecorationXfbBuffer, TransformFeedback), 455 CASE1(DECORATION, DecorationXfbStride, TransformFeedback), 456 CASE1(DECORATION, DecorationFuncParamAttr, Kernel), 457 CASE1(DECORATION, DecorationFPFastMathMode, Kernel), 458 CASE1(DECORATION, DecorationLinkageAttributes, Linkage), 459 CASE1(DECORATION, DecorationNoContraction, Shader), 460 CASE1(DECORATION, DecorationInputAttachmentIndex, 461 InputAttachment), 462 CASE1(DECORATION, DecorationAlignment, Kernel), 463 })), ); 464 465 #if 0 466 // SpecId has different requirements in v1.0 and v1.1: 467 INSTANTIATE_TEST_CASE_P(DecorationSpecIdV10, EnumCapabilityTest, 468 Combine(Values(SPV_ENV_UNIVERSAL_1_0), 469 ValuesIn(std::vector<EnumCapabilityCase>{CASE1( 470 DECORATION, DecorationSpecId, Shader)})), ); 471 #endif 472 473 INSTANTIATE_TEST_CASE_P( 474 DecorationV11, EnumCapabilityTest, 475 Combine(Values(SPV_ENV_UNIVERSAL_1_1), 476 ValuesIn(std::vector<EnumCapabilityCase>{ 477 CASE2(DECORATION, DecorationSpecId, Shader, Kernel), 478 CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})), ); 479 480 // See SPIR-V Section 3.21 BuiltIn 481 INSTANTIATE_TEST_CASE_P( 482 BuiltIn, EnumCapabilityTest, 483 Combine( 484 Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 485 ValuesIn(std::vector<EnumCapabilityCase>{ 486 // clang-format off 487 CASE1(BUILT_IN, BuiltInPosition, Shader), 488 CASE1(BUILT_IN, BuiltInPointSize, Shader), 489 // 2 is an intentional gap in the spec numbering. 490 CASE1(BUILT_IN, BuiltInClipDistance, ClipDistance), // Bug 1407, 15234 491 CASE1(BUILT_IN, BuiltInCullDistance, CullDistance), // Bug 1407, 15234 492 CASE1(BUILT_IN, BuiltInVertexId, Shader), 493 CASE1(BUILT_IN, BuiltInInstanceId, Shader), 494 CASE3(BUILT_IN, BuiltInPrimitiveId, Geometry, Tessellation, 495 RayTracingNV), 496 CASE2(BUILT_IN, BuiltInInvocationId, Geometry, Tessellation), 497 CASE1(BUILT_IN, BuiltInLayer, Geometry), 498 CASE1(BUILT_IN, BuiltInViewportIndex, MultiViewport), // Bug 15234 499 CASE1(BUILT_IN, BuiltInTessLevelOuter, Tessellation), 500 CASE1(BUILT_IN, BuiltInTessLevelInner, Tessellation), 501 CASE1(BUILT_IN, BuiltInTessCoord, Tessellation), 502 CASE1(BUILT_IN, BuiltInPatchVertices, Tessellation), 503 CASE1(BUILT_IN, BuiltInFragCoord, Shader), 504 CASE1(BUILT_IN, BuiltInPointCoord, Shader), 505 CASE1(BUILT_IN, BuiltInFrontFacing, Shader), 506 CASE1(BUILT_IN, BuiltInSampleId, SampleRateShading), // Bug 15234 507 CASE1(BUILT_IN, BuiltInSamplePosition, SampleRateShading), // Bug 15234 508 CASE1(BUILT_IN, BuiltInSampleMask, Shader), // Bug 15234, Issue 182 509 // Value 21 intentionally missing 510 CASE1(BUILT_IN, BuiltInFragDepth, Shader), 511 CASE1(BUILT_IN, BuiltInHelperInvocation, Shader), 512 CASE0(BUILT_IN, BuiltInNumWorkgroups), 513 CASE0(BUILT_IN, BuiltInWorkgroupSize), 514 CASE0(BUILT_IN, BuiltInWorkgroupId), 515 CASE0(BUILT_IN, BuiltInLocalInvocationId), 516 CASE0(BUILT_IN, BuiltInGlobalInvocationId), 517 CASE0(BUILT_IN, BuiltInLocalInvocationIndex), 518 CASE1(BUILT_IN, BuiltInWorkDim, Kernel), 519 CASE1(BUILT_IN, BuiltInGlobalSize, Kernel), 520 CASE1(BUILT_IN, BuiltInEnqueuedWorkgroupSize, Kernel), 521 CASE1(BUILT_IN, BuiltInGlobalOffset, Kernel), 522 CASE1(BUILT_IN, BuiltInGlobalLinearId, Kernel), 523 // Value 35 intentionally missing 524 CASE2(BUILT_IN, BuiltInSubgroupSize, Kernel, SubgroupBallotKHR), 525 CASE1(BUILT_IN, BuiltInSubgroupMaxSize, Kernel), 526 CASE1(BUILT_IN, BuiltInNumSubgroups, Kernel), 527 CASE1(BUILT_IN, BuiltInNumEnqueuedSubgroups, Kernel), 528 CASE1(BUILT_IN, BuiltInSubgroupId, Kernel), 529 CASE2(BUILT_IN, BuiltInSubgroupLocalInvocationId, Kernel, SubgroupBallotKHR), 530 CASE1(BUILT_IN, BuiltInVertexIndex, Shader), 531 CASE1(BUILT_IN, BuiltInInstanceIndex, Shader), 532 // clang-format on 533 })), ); 534 535 // See SPIR-V Section 3.22 Selection Control 536 INSTANTIATE_TEST_CASE_P( 537 SelectionControl, EnumCapabilityTest, 538 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 539 ValuesIn(std::vector<EnumCapabilityCase>{ 540 CASE0(SELECTION_CONTROL, SelectionControlMaskNone), 541 CASE0(SELECTION_CONTROL, SelectionControlFlattenMask), 542 CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask), 543 })), ); 544 545 // See SPIR-V Section 3.23 Loop Control 546 INSTANTIATE_TEST_CASE_P( 547 LoopControl, EnumCapabilityTest, 548 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 549 ValuesIn(std::vector<EnumCapabilityCase>{ 550 CASE0(LOOP_CONTROL, LoopControlMaskNone), 551 CASE0(LOOP_CONTROL, LoopControlUnrollMask), 552 CASE0(LOOP_CONTROL, LoopControlDontUnrollMask), 553 })), ); 554 555 INSTANTIATE_TEST_CASE_P( 556 LoopControlV11, EnumCapabilityTest, 557 Combine(Values(SPV_ENV_UNIVERSAL_1_1), 558 ValuesIn(std::vector<EnumCapabilityCase>{ 559 CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask), 560 CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask), 561 })), ); 562 563 // See SPIR-V Section 3.24 Function Control 564 INSTANTIATE_TEST_CASE_P( 565 FunctionControl, EnumCapabilityTest, 566 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 567 ValuesIn(std::vector<EnumCapabilityCase>{ 568 CASE0(FUNCTION_CONTROL, FunctionControlMaskNone), 569 CASE0(FUNCTION_CONTROL, FunctionControlInlineMask), 570 CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask), 571 CASE0(FUNCTION_CONTROL, FunctionControlPureMask), 572 CASE0(FUNCTION_CONTROL, FunctionControlConstMask), 573 })), ); 574 575 // See SPIR-V Section 3.25 Memory Semantics <id> 576 INSTANTIATE_TEST_CASE_P( 577 MemorySemantics, EnumCapabilityTest, 578 Combine( 579 Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 580 ValuesIn(std::vector<EnumCapabilityCase>{ 581 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMaskNone), 582 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireMask), 583 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsReleaseMask), 584 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireReleaseMask), 585 CASE0(MEMORY_SEMANTICS_ID, 586 MemorySemanticsSequentiallyConsistentMask), 587 CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsUniformMemoryMask, 588 Shader), 589 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsSubgroupMemoryMask), 590 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsWorkgroupMemoryMask), 591 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsCrossWorkgroupMemoryMask), 592 CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask, 593 AtomicStorage), // Bug 15234 594 CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask), 595 })), ); 596 597 // See SPIR-V Section 3.26 Memory Access 598 INSTANTIATE_TEST_CASE_P( 599 MemoryAccess, EnumCapabilityTest, 600 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 601 ValuesIn(std::vector<EnumCapabilityCase>{ 602 CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMaskNone), 603 CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask), 604 CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask), 605 CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask), 606 })), ); 607 608 // See SPIR-V Section 3.27 Scope <id> 609 INSTANTIATE_TEST_CASE_P( 610 Scope, EnumCapabilityTest, 611 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, 612 SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3), 613 ValuesIn(std::vector<EnumCapabilityCase>{ 614 CASE0(SCOPE_ID, ScopeCrossDevice), 615 CASE0(SCOPE_ID, ScopeDevice), 616 CASE0(SCOPE_ID, ScopeWorkgroup), 617 CASE0(SCOPE_ID, ScopeSubgroup), 618 CASE0(SCOPE_ID, ScopeInvocation), 619 CASE1(SCOPE_ID, ScopeQueueFamilyKHR, VulkanMemoryModelKHR), 620 })), ); 621 622 // See SPIR-V Section 3.28 Group Operation 623 INSTANTIATE_TEST_CASE_P( 624 GroupOperation, EnumCapabilityTest, 625 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 626 ValuesIn(std::vector<EnumCapabilityCase>{ 627 CASE3(GROUP_OPERATION, GroupOperationReduce, Kernel, 628 GroupNonUniformArithmetic, GroupNonUniformBallot), 629 CASE3(GROUP_OPERATION, GroupOperationInclusiveScan, Kernel, 630 GroupNonUniformArithmetic, GroupNonUniformBallot), 631 CASE3(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel, 632 GroupNonUniformArithmetic, GroupNonUniformBallot), 633 })), ); 634 635 // See SPIR-V Section 3.29 Kernel Enqueue Flags 636 INSTANTIATE_TEST_CASE_P( 637 KernelEnqueueFlags, EnumCapabilityTest, 638 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 639 ValuesIn(std::vector<EnumCapabilityCase>{ 640 CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsNoWait, Kernel), 641 CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel), 642 CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup, 643 Kernel), 644 })), ); 645 646 // See SPIR-V Section 3.30 Kernel Profiling Info 647 INSTANTIATE_TEST_CASE_P( 648 KernelProfilingInfo, EnumCapabilityTest, 649 Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 650 ValuesIn(std::vector<EnumCapabilityCase>{ 651 CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone), 652 CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask, 653 Kernel), 654 })), ); 655 656 // See SPIR-V Section 3.31 Capability 657 INSTANTIATE_TEST_CASE_P( 658 CapabilityDependsOn, EnumCapabilityTest, 659 Combine( 660 Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1), 661 ValuesIn(std::vector<EnumCapabilityCase>{ 662 // clang-format off 663 CASE0(CAPABILITY, CapabilityMatrix), 664 CASE1(CAPABILITY, CapabilityShader, Matrix), 665 CASE1(CAPABILITY, CapabilityGeometry, Shader), 666 CASE1(CAPABILITY, CapabilityTessellation, Shader), 667 CASE0(CAPABILITY, CapabilityAddresses), 668 CASE0(CAPABILITY, CapabilityLinkage), 669 CASE0(CAPABILITY, CapabilityKernel), 670 CASE1(CAPABILITY, CapabilityVector16, Kernel), 671 CASE1(CAPABILITY, CapabilityFloat16Buffer, Kernel), 672 CASE0(CAPABILITY, CapabilityFloat16), // Bug 15234 673 CASE0(CAPABILITY, CapabilityFloat64), 674 CASE0(CAPABILITY, CapabilityInt64), 675 CASE1(CAPABILITY, CapabilityInt64Atomics, Int64), 676 CASE1(CAPABILITY, CapabilityImageBasic, Kernel), 677 CASE1(CAPABILITY, CapabilityImageReadWrite, ImageBasic), 678 CASE1(CAPABILITY, CapabilityImageMipmap, ImageBasic), 679 // Value 16 intentionally missing. 680 CASE1(CAPABILITY, CapabilityPipes, Kernel), 681 CASE0(CAPABILITY, CapabilityGroups), 682 CASE1(CAPABILITY, CapabilityDeviceEnqueue, Kernel), 683 CASE1(CAPABILITY, CapabilityLiteralSampler, Kernel), 684 CASE1(CAPABILITY, CapabilityAtomicStorage, Shader), 685 CASE0(CAPABILITY, CapabilityInt16), 686 CASE1(CAPABILITY, CapabilityTessellationPointSize, Tessellation), 687 CASE1(CAPABILITY, CapabilityGeometryPointSize, Geometry), 688 CASE1(CAPABILITY, CapabilityImageGatherExtended, Shader), 689 // Value 26 intentionally missing. 690 CASE1(CAPABILITY, CapabilityStorageImageMultisample, Shader), 691 CASE1(CAPABILITY, CapabilityUniformBufferArrayDynamicIndexing, Shader), 692 CASE1(CAPABILITY, CapabilitySampledImageArrayDynamicIndexing, Shader), 693 CASE1(CAPABILITY, CapabilityStorageBufferArrayDynamicIndexing, Shader), 694 CASE1(CAPABILITY, CapabilityStorageImageArrayDynamicIndexing, Shader), 695 CASE1(CAPABILITY, CapabilityClipDistance, Shader), 696 CASE1(CAPABILITY, CapabilityCullDistance, Shader), 697 CASE1(CAPABILITY, CapabilityImageCubeArray, SampledCubeArray), 698 CASE1(CAPABILITY, CapabilitySampleRateShading, Shader), 699 CASE1(CAPABILITY, CapabilityImageRect, SampledRect), 700 CASE1(CAPABILITY, CapabilitySampledRect, Shader), 701 CASE1(CAPABILITY, CapabilityGenericPointer, Addresses), 702 CASE0(CAPABILITY, CapabilityInt8), 703 CASE1(CAPABILITY, CapabilityInputAttachment, Shader), 704 CASE1(CAPABILITY, CapabilitySparseResidency, Shader), 705 CASE1(CAPABILITY, CapabilityMinLod, Shader), 706 CASE1(CAPABILITY, CapabilityImage1D, Sampled1D), 707 CASE1(CAPABILITY, CapabilitySampledCubeArray, Shader), 708 CASE1(CAPABILITY, CapabilityImageBuffer, SampledBuffer), 709 CASE1(CAPABILITY, CapabilityImageMSArray, Shader), 710 CASE1(CAPABILITY, CapabilityStorageImageExtendedFormats, Shader), 711 CASE1(CAPABILITY, CapabilityImageQuery, Shader), 712 CASE1(CAPABILITY, CapabilityDerivativeControl, Shader), 713 CASE1(CAPABILITY, CapabilityInterpolationFunction, Shader), 714 CASE1(CAPABILITY, CapabilityTransformFeedback, Shader), 715 CASE1(CAPABILITY, CapabilityGeometryStreams, Geometry), 716 CASE1(CAPABILITY, CapabilityStorageImageReadWithoutFormat, Shader), 717 CASE1(CAPABILITY, CapabilityStorageImageWriteWithoutFormat, Shader), 718 CASE1(CAPABILITY, CapabilityMultiViewport, Geometry), 719 // clang-format on 720 })), ); 721 722 INSTANTIATE_TEST_CASE_P( 723 CapabilityDependsOnV11, EnumCapabilityTest, 724 Combine(Values(SPV_ENV_UNIVERSAL_1_1), 725 ValuesIn(std::vector<EnumCapabilityCase>{ 726 CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue), 727 CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel), 728 CASE1(CAPABILITY, CapabilityPipeStorage, Pipes), 729 })), ); 730 731 #undef CASE0 732 #undef CASE1 733 #undef CASE2 734 735 } // namespace 736 } // namespace spvtools 737