2016-01-07 18:44:22 +00:00
|
|
|
// Copyright (c) 2015-2016 The Khronos Group Inc.
|
2015-10-02 21:10:10 +00:00
|
|
|
//
|
2016-09-01 19:33:59 +00:00
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
2015-10-02 21:10:10 +00:00
|
|
|
//
|
2016-09-01 19:33:59 +00:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2015-10-02 21:10:10 +00:00
|
|
|
//
|
2016-09-01 19:33:59 +00:00
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// Test capability dependencies for enums.
|
|
|
|
|
2016-04-26 16:16:00 +00:00
|
|
|
#include <tuple>
|
2018-08-03 19:06:09 +00:00
|
|
|
#include <vector>
|
2016-04-26 16:16:00 +00:00
|
|
|
|
2016-08-29 18:49:00 +00:00
|
|
|
#include "gmock/gmock.h"
|
2018-08-03 19:06:09 +00:00
|
|
|
#include "source/enum_set.h"
|
|
|
|
#include "test/unit_spirv.h"
|
2015-10-02 21:10:10 +00:00
|
|
|
|
2018-07-07 13:38:00 +00:00
|
|
|
namespace spvtools {
|
2015-10-02 21:10:10 +00:00
|
|
|
namespace {
|
|
|
|
|
2018-03-14 17:06:18 +00:00
|
|
|
using spvtest::ElementsIn;
|
2016-04-26 16:16:00 +00:00
|
|
|
using ::testing::Combine;
|
2016-08-29 18:49:00 +00:00
|
|
|
using ::testing::Eq;
|
2016-04-26 16:16:00 +00:00
|
|
|
using ::testing::TestWithParam;
|
|
|
|
using ::testing::Values;
|
|
|
|
using ::testing::ValuesIn;
|
|
|
|
|
2015-10-02 21:10:10 +00:00
|
|
|
// A test case for mapping an enum to a capability mask.
|
|
|
|
struct EnumCapabilityCase {
|
|
|
|
spv_operand_type_t type;
|
|
|
|
uint32_t value;
|
2016-08-29 18:49:00 +00:00
|
|
|
CapabilitySet expected_capabilities;
|
2015-10-02 21:10:10 +00:00
|
|
|
};
|
|
|
|
|
2016-04-21 19:46:08 +00:00
|
|
|
// Test fixture for testing EnumCapabilityCases.
|
2016-04-26 16:16:00 +00:00
|
|
|
using EnumCapabilityTest =
|
2018-08-01 18:58:12 +00:00
|
|
|
TestWithParam<std::tuple<spv_target_env, EnumCapabilityCase>>;
|
2016-04-21 19:46:08 +00:00
|
|
|
|
2016-04-26 16:16:00 +00:00
|
|
|
TEST_P(EnumCapabilityTest, Sample) {
|
2018-08-01 18:58:12 +00:00
|
|
|
const auto env = std::get<0>(GetParam());
|
2018-03-14 17:06:18 +00:00
|
|
|
const auto context = spvContextCreate(env);
|
2018-07-07 13:38:00 +00:00
|
|
|
const AssemblyGrammar grammar(context);
|
2015-10-02 21:10:10 +00:00
|
|
|
spv_operand_desc entry;
|
2018-03-14 17:06:18 +00:00
|
|
|
|
2015-10-02 21:10:10 +00:00
|
|
|
ASSERT_EQ(SPV_SUCCESS,
|
2018-08-01 18:58:12 +00:00
|
|
|
grammar.lookupOperand(std::get<1>(GetParam()).type,
|
|
|
|
std::get<1>(GetParam()).value, &entry));
|
2018-03-14 17:06:18 +00:00
|
|
|
const auto cap_set = grammar.filterCapsAgainstTargetEnv(
|
|
|
|
entry->capabilities, entry->numCapabilities);
|
|
|
|
|
|
|
|
EXPECT_THAT(ElementsIn(cap_set),
|
2018-08-01 18:58:12 +00:00
|
|
|
Eq(ElementsIn(std::get<1>(GetParam()).expected_capabilities)))
|
|
|
|
<< " capability value " << std::get<1>(GetParam()).value;
|
2018-06-06 06:07:51 +00:00
|
|
|
spvContextDestroy(context);
|
2015-10-02 21:10:10 +00:00
|
|
|
}
|
|
|
|
|
2016-08-29 18:49:00 +00:00
|
|
|
#define CASE0(TYPE, VALUE) \
|
|
|
|
{ \
|
|
|
|
SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), {} \
|
|
|
|
}
|
|
|
|
#define CASE1(TYPE, VALUE, CAP) \
|
|
|
|
{ \
|
|
|
|
SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \
|
|
|
|
SpvCapability##CAP \
|
|
|
|
} \
|
2015-10-02 21:10:10 +00:00
|
|
|
}
|
2016-08-29 18:49:00 +00:00
|
|
|
#define CASE2(TYPE, VALUE, CAP1, CAP2) \
|
|
|
|
{ \
|
|
|
|
SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \
|
|
|
|
SpvCapability##CAP1, SpvCapability##CAP2 \
|
|
|
|
} \
|
2015-10-02 21:10:10 +00:00
|
|
|
}
|
2018-06-06 06:07:51 +00:00
|
|
|
#define CASE3(TYPE, VALUE, CAP1, CAP2, CAP3) \
|
|
|
|
{ \
|
|
|
|
SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \
|
|
|
|
SpvCapability##CAP1, SpvCapability##CAP2, SpvCapability##CAP3 \
|
|
|
|
} \
|
|
|
|
}
|
2020-03-17 19:30:19 +00:00
|
|
|
#define CASE4(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4) \
|
|
|
|
{ \
|
|
|
|
SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \
|
|
|
|
SpvCapability##CAP1, SpvCapability##CAP2, SpvCapability##CAP3, \
|
|
|
|
SpvCapability##CAP4 \
|
|
|
|
} \
|
|
|
|
}
|
2017-03-23 19:46:08 +00:00
|
|
|
#define CASE5(TYPE, VALUE, CAP1, CAP2, CAP3, CAP4, CAP5) \
|
|
|
|
{ \
|
|
|
|
SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), CapabilitySet { \
|
|
|
|
SpvCapability##CAP1, SpvCapability##CAP2, SpvCapability##CAP3, \
|
|
|
|
SpvCapability##CAP4, SpvCapability##CAP5 \
|
|
|
|
} \
|
|
|
|
}
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.3 Execution Model
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
ExecutionModel, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(EXECUTION_MODEL, ExecutionModelVertex, Shader),
|
|
|
|
CASE1(EXECUTION_MODEL, ExecutionModelTessellationControl,
|
|
|
|
Tessellation),
|
|
|
|
CASE1(EXECUTION_MODEL, ExecutionModelTessellationEvaluation,
|
|
|
|
Tessellation),
|
|
|
|
CASE1(EXECUTION_MODEL, ExecutionModelGeometry, Geometry),
|
|
|
|
CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader),
|
|
|
|
CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader),
|
|
|
|
CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.4 Addressing Model
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
AddressingModel, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(ADDRESSING_MODEL, AddressingModelLogical),
|
|
|
|
CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses),
|
|
|
|
CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.5 Memory Model
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
MemoryModel, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(MEMORY_MODEL, MemoryModelSimple, Shader),
|
|
|
|
CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader),
|
|
|
|
CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.6 Execution Mode
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
ExecutionMode, EnumCapabilityTest,
|
|
|
|
Combine(
|
|
|
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeInvocations, Geometry),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeSpacingEqual, Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalEven,
|
|
|
|
Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeSpacingFractionalOdd,
|
|
|
|
Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCw, Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeVertexOrderCcw, Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModePixelCenterInteger, Shader),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeOriginUpperLeft, Shader),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeOriginLowerLeft, Shader),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeEarlyFragmentTests, Shader),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModePointMode, Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeXfb, TransformFeedback),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeDepthReplacing, Shader),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeDepthGreater, Shader),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeDepthLess, Shader),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeDepthUnchanged, Shader),
|
|
|
|
CASE0(EXECUTION_MODE, ExecutionModeLocalSize),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeLocalSizeHint, Kernel),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeInputPoints, Geometry),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeInputLines, Geometry),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeInputLinesAdjacency, Geometry),
|
|
|
|
CASE2(EXECUTION_MODE, ExecutionModeTriangles, Geometry,
|
|
|
|
Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeInputTrianglesAdjacency,
|
|
|
|
Geometry),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeQuads, Tessellation),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeIsolines, Tessellation),
|
2018-09-19 18:53:33 +00:00
|
|
|
CASE3(EXECUTION_MODE, ExecutionModeOutputVertices, Geometry,
|
|
|
|
Tessellation, MeshShadingNV),
|
|
|
|
CASE2(EXECUTION_MODE, ExecutionModeOutputPoints, Geometry,
|
|
|
|
MeshShadingNV),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeOutputLineStrip, Geometry),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeOutputTriangleStrip, Geometry),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeVecTypeHint, Kernel),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2016-04-26 16:16:00 +00:00
|
|
|
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
ExecutionModeV11, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
2016-04-27 21:04:37 +00:00
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeInitializer, Kernel),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeFinalizer, Kernel),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize,
|
|
|
|
SubgroupDispatch),
|
|
|
|
CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup,
|
2019-01-29 23:56:52 +00:00
|
|
|
SubgroupDispatch)})));
|
2016-04-21 19:46:08 +00:00
|
|
|
|
2015-10-02 21:10:10 +00:00
|
|
|
// See SPIR-V Section 3.7 Storage Class
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
StorageClass, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(STORAGE_CLASS, StorageClassUniformConstant),
|
|
|
|
CASE1(STORAGE_CLASS, StorageClassUniform, Shader),
|
|
|
|
CASE1(STORAGE_CLASS, StorageClassOutput, Shader),
|
|
|
|
CASE0(STORAGE_CLASS, StorageClassWorkgroup),
|
|
|
|
CASE0(STORAGE_CLASS, StorageClassCrossWorkgroup),
|
|
|
|
CASE1(STORAGE_CLASS, StorageClassPrivate, Shader),
|
|
|
|
CASE0(STORAGE_CLASS, StorageClassFunction),
|
|
|
|
CASE1(STORAGE_CLASS, StorageClassGeneric,
|
|
|
|
GenericPointer), // Bug 14287
|
|
|
|
CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader),
|
|
|
|
CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage),
|
|
|
|
CASE0(STORAGE_CLASS, StorageClassImage),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.8 Dim
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
Dim, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
2018-09-05 19:42:21 +00:00
|
|
|
CASE2(DIMENSIONALITY, Dim1D, Sampled1D, Image1D),
|
|
|
|
CASE3(DIMENSIONALITY, Dim2D, Kernel, Shader, ImageMSArray),
|
2017-11-27 15:16:41 +00:00
|
|
|
CASE0(DIMENSIONALITY, Dim3D),
|
2018-09-05 19:42:21 +00:00
|
|
|
CASE2(DIMENSIONALITY, DimCube, Shader, ImageCubeArray),
|
|
|
|
CASE2(DIMENSIONALITY, DimRect, SampledRect, ImageRect),
|
|
|
|
CASE2(DIMENSIONALITY, DimBuffer, SampledBuffer, ImageBuffer),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.9 Sampler Addressing Mode
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
SamplerAddressingMode, EnumCapabilityTest,
|
|
|
|
Combine(
|
|
|
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeNone, Kernel),
|
|
|
|
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClampToEdge,
|
|
|
|
Kernel),
|
|
|
|
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeClamp, Kernel),
|
|
|
|
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeat, Kernel),
|
|
|
|
CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeatMirrored,
|
|
|
|
Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.10 Sampler Filter Mode
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
SamplerFilterMode, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel),
|
|
|
|
CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.11 Image Format
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
ImageFormat, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
// clang-format off
|
2015-10-02 21:10:10 +00:00
|
|
|
CASE0(SAMPLER_IMAGE_FORMAT, ImageFormatUnknown),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32f, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16f, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32f, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8Snorm, Shader),
|
2015-11-11 17:32:21 +00:00
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32f, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16f, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR11fG11fB10f, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16f, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10A2, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16Snorm, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16Snorm, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8Snorm, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16Snorm, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8Snorm, StorageImageExtendedFormats),
|
2015-10-02 21:10:10 +00:00
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32i, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16i, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8i, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR32i, Shader),
|
2015-11-11 17:32:21 +00:00
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32i, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16i, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8i, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16i, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8i, StorageImageExtendedFormats),
|
2015-10-02 21:10:10 +00:00
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba32ui, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba16ui, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgba8ui, Shader),
|
2015-11-11 17:32:21 +00:00
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRgb10a2ui, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg32ui, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg16ui, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatRg8ui, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats),
|
|
|
|
CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats),
|
2016-04-26 16:16:00 +00:00
|
|
|
// clang-format on
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.12 Image Channel Order
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
ImageChannelOrder, EnumCapabilityTest,
|
2017-10-25 16:15:51 +00:00
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderR, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderA, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRG, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRA, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGB, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBA, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderBGRA, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderARGB, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderIntensity, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderLuminance, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRx, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGx, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderRGBx, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepth, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderDepthStencil,
|
|
|
|
Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGB, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBx, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.13 Image Channel Data Type
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
ImageChannelDataType, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
// clang-format off
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt8, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSnormInt16, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt8, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt16, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort565, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormShort555, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt8, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt16, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeSignedInt32, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt8, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt16, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnsignedInt32, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeHalfFloat, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeFloat, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel),
|
|
|
|
CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel),
|
|
|
|
// clang-format on
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.14 Image Operands
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
ImageOperands, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
// clang-format off
|
|
|
|
CASE0(OPTIONAL_IMAGE, ImageOperandsMaskNone),
|
|
|
|
CASE1(OPTIONAL_IMAGE, ImageOperandsBiasMask, Shader),
|
|
|
|
CASE0(OPTIONAL_IMAGE, ImageOperandsLodMask),
|
|
|
|
CASE0(OPTIONAL_IMAGE, ImageOperandsGradMask),
|
|
|
|
CASE0(OPTIONAL_IMAGE, ImageOperandsConstOffsetMask),
|
|
|
|
CASE1(OPTIONAL_IMAGE, ImageOperandsOffsetMask, ImageGatherExtended),
|
2018-05-10 20:32:13 +00:00
|
|
|
CASE1(OPTIONAL_IMAGE, ImageOperandsConstOffsetsMask, ImageGatherExtended),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask),
|
|
|
|
CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod),
|
|
|
|
// clang-format on
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.15 FP Fast Math Mode
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
FPFastMathMode, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(FP_FAST_MATH_MODE, FPFastMathModeMaskNone),
|
|
|
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotNaNMask, Kernel),
|
|
|
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeNotInfMask, Kernel),
|
|
|
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel),
|
|
|
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel),
|
|
|
|
CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.17 Linkage Type
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
LinkageType, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage),
|
|
|
|
CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.18 Access Qualifier
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
AccessQualifier, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel),
|
|
|
|
CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel),
|
|
|
|
CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.19 Function Parameter Attribute
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
FunctionParameterAttribute, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
// clang-format off
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeZext, Kernel),
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSext, Kernel),
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeByVal, Kernel),
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeSret, Kernel),
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoAlias, Kernel),
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoCapture, Kernel),
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel),
|
|
|
|
CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel),
|
|
|
|
// clang-format on
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.20 Decoration
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
Decoration, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(DECORATION, DecorationRelaxedPrecision, Shader),
|
|
|
|
// DecorationSpecId handled below.
|
|
|
|
CASE1(DECORATION, DecorationBlock, Shader),
|
|
|
|
CASE1(DECORATION, DecorationBufferBlock, Shader),
|
|
|
|
CASE1(DECORATION, DecorationRowMajor, Matrix),
|
|
|
|
CASE1(DECORATION, DecorationColMajor, Matrix),
|
|
|
|
CASE1(DECORATION, DecorationArrayStride, Shader),
|
|
|
|
CASE1(DECORATION, DecorationMatrixStride, Matrix), // Bug 15234
|
|
|
|
CASE1(DECORATION, DecorationGLSLShared, Shader),
|
|
|
|
CASE1(DECORATION, DecorationGLSLPacked, Shader),
|
|
|
|
CASE1(DECORATION, DecorationCPacked, Kernel),
|
|
|
|
CASE0(DECORATION, DecorationBuiltIn), // Bug 15248
|
|
|
|
// Value 12 placeholder
|
|
|
|
CASE1(DECORATION, DecorationNoPerspective, Shader),
|
|
|
|
CASE1(DECORATION, DecorationFlat, Shader),
|
|
|
|
CASE1(DECORATION, DecorationPatch, Tessellation),
|
|
|
|
CASE1(DECORATION, DecorationCentroid, Shader),
|
|
|
|
CASE1(DECORATION, DecorationSample,
|
|
|
|
SampleRateShading), // Bug 15234
|
|
|
|
CASE1(DECORATION, DecorationInvariant, Shader),
|
|
|
|
CASE0(DECORATION, DecorationRestrict),
|
|
|
|
CASE0(DECORATION, DecorationAliased),
|
|
|
|
CASE0(DECORATION, DecorationVolatile),
|
|
|
|
CASE1(DECORATION, DecorationConstant, Kernel),
|
|
|
|
CASE0(DECORATION, DecorationCoherent),
|
|
|
|
CASE0(DECORATION, DecorationNonWritable),
|
|
|
|
CASE0(DECORATION, DecorationNonReadable),
|
|
|
|
CASE1(DECORATION, DecorationUniform, Shader),
|
|
|
|
// Value 27 is an intentional gap in the spec numbering.
|
|
|
|
CASE1(DECORATION, DecorationSaturatedConversion, Kernel),
|
|
|
|
CASE1(DECORATION, DecorationStream, GeometryStreams),
|
|
|
|
CASE1(DECORATION, DecorationLocation, Shader),
|
|
|
|
CASE1(DECORATION, DecorationComponent, Shader),
|
|
|
|
CASE1(DECORATION, DecorationIndex, Shader),
|
|
|
|
CASE1(DECORATION, DecorationBinding, Shader),
|
|
|
|
CASE1(DECORATION, DecorationDescriptorSet, Shader),
|
|
|
|
CASE1(DECORATION, DecorationOffset, Shader), // Bug 15268
|
|
|
|
CASE1(DECORATION, DecorationXfbBuffer, TransformFeedback),
|
|
|
|
CASE1(DECORATION, DecorationXfbStride, TransformFeedback),
|
|
|
|
CASE1(DECORATION, DecorationFuncParamAttr, Kernel),
|
|
|
|
CASE1(DECORATION, DecorationFPFastMathMode, Kernel),
|
|
|
|
CASE1(DECORATION, DecorationLinkageAttributes, Linkage),
|
|
|
|
CASE1(DECORATION, DecorationNoContraction, Shader),
|
|
|
|
CASE1(DECORATION, DecorationInputAttachmentIndex,
|
|
|
|
InputAttachment),
|
|
|
|
CASE1(DECORATION, DecorationAlignment, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2016-04-26 16:16:00 +00:00
|
|
|
|
2016-08-29 18:49:00 +00:00
|
|
|
#if 0
|
2016-04-26 16:16:00 +00:00
|
|
|
// SpecId has different requirements in v1.0 and v1.1:
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(DecorationSpecIdV10, EnumCapabilityTest,
|
2016-08-29 18:49:00 +00:00
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{CASE1(
|
2019-01-29 23:56:52 +00:00
|
|
|
DECORATION, DecorationSpecId, Shader)})));
|
2016-08-29 18:49:00 +00:00
|
|
|
#endif
|
2016-04-26 16:16:00 +00:00
|
|
|
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-05-10 03:15:46 +00:00
|
|
|
DecorationV11, EnumCapabilityTest,
|
2016-04-26 16:16:00 +00:00
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
2016-05-10 03:15:46 +00:00
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE2(DECORATION, DecorationSpecId, Shader, Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})));
|
2015-10-02 21:10:10 +00:00
|
|
|
|
2015-10-05 13:55:23 +00:00
|
|
|
// See SPIR-V Section 3.21 BuiltIn
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
BuiltIn, EnumCapabilityTest,
|
|
|
|
Combine(
|
|
|
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
// clang-format off
|
|
|
|
CASE1(BUILT_IN, BuiltInPosition, Shader),
|
|
|
|
CASE1(BUILT_IN, BuiltInPointSize, Shader),
|
|
|
|
// 2 is an intentional gap in the spec numbering.
|
|
|
|
CASE1(BUILT_IN, BuiltInClipDistance, ClipDistance), // Bug 1407, 15234
|
|
|
|
CASE1(BUILT_IN, BuiltInCullDistance, CullDistance), // Bug 1407, 15234
|
|
|
|
CASE1(BUILT_IN, BuiltInVertexId, Shader),
|
|
|
|
CASE1(BUILT_IN, BuiltInInstanceId, Shader),
|
2020-11-23 17:23:54 +00:00
|
|
|
CASE5(BUILT_IN, BuiltInPrimitiveId, Geometry, Tessellation,
|
|
|
|
RayTracingNV, RayTracingKHR, MeshShadingNV),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE2(BUILT_IN, BuiltInInvocationId, Geometry, Tessellation),
|
2020-11-23 17:23:54 +00:00
|
|
|
CASE3(BUILT_IN, BuiltInLayer, Geometry, ShaderViewportIndexLayerEXT, MeshShadingNV),
|
|
|
|
CASE3(BUILT_IN, BuiltInViewportIndex, MultiViewport, ShaderViewportIndexLayerEXT, MeshShadingNV), // Bug 15234
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE1(BUILT_IN, BuiltInTessLevelOuter, Tessellation),
|
|
|
|
CASE1(BUILT_IN, BuiltInTessLevelInner, Tessellation),
|
|
|
|
CASE1(BUILT_IN, BuiltInTessCoord, Tessellation),
|
|
|
|
CASE1(BUILT_IN, BuiltInPatchVertices, Tessellation),
|
|
|
|
CASE1(BUILT_IN, BuiltInFragCoord, Shader),
|
|
|
|
CASE1(BUILT_IN, BuiltInPointCoord, Shader),
|
|
|
|
CASE1(BUILT_IN, BuiltInFrontFacing, Shader),
|
|
|
|
CASE1(BUILT_IN, BuiltInSampleId, SampleRateShading), // Bug 15234
|
|
|
|
CASE1(BUILT_IN, BuiltInSamplePosition, SampleRateShading), // Bug 15234
|
2017-08-23 17:28:48 +00:00
|
|
|
CASE1(BUILT_IN, BuiltInSampleMask, Shader), // Bug 15234, Issue 182
|
2016-04-26 16:16:00 +00:00
|
|
|
// Value 21 intentionally missing
|
|
|
|
CASE1(BUILT_IN, BuiltInFragDepth, Shader),
|
|
|
|
CASE1(BUILT_IN, BuiltInHelperInvocation, Shader),
|
|
|
|
CASE0(BUILT_IN, BuiltInNumWorkgroups),
|
|
|
|
CASE0(BUILT_IN, BuiltInWorkgroupSize),
|
|
|
|
CASE0(BUILT_IN, BuiltInWorkgroupId),
|
|
|
|
CASE0(BUILT_IN, BuiltInLocalInvocationId),
|
|
|
|
CASE0(BUILT_IN, BuiltInGlobalInvocationId),
|
|
|
|
CASE0(BUILT_IN, BuiltInLocalInvocationIndex),
|
|
|
|
CASE1(BUILT_IN, BuiltInWorkDim, Kernel),
|
|
|
|
CASE1(BUILT_IN, BuiltInGlobalSize, Kernel),
|
|
|
|
CASE1(BUILT_IN, BuiltInEnqueuedWorkgroupSize, Kernel),
|
|
|
|
CASE1(BUILT_IN, BuiltInGlobalOffset, Kernel),
|
|
|
|
CASE1(BUILT_IN, BuiltInGlobalLinearId, Kernel),
|
|
|
|
// Value 35 intentionally missing
|
2018-02-16 00:40:47 +00:00
|
|
|
CASE2(BUILT_IN, BuiltInSubgroupSize, Kernel, SubgroupBallotKHR),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE1(BUILT_IN, BuiltInSubgroupMaxSize, Kernel),
|
|
|
|
CASE1(BUILT_IN, BuiltInNumSubgroups, Kernel),
|
|
|
|
CASE1(BUILT_IN, BuiltInNumEnqueuedSubgroups, Kernel),
|
|
|
|
CASE1(BUILT_IN, BuiltInSubgroupId, Kernel),
|
2018-02-16 00:40:47 +00:00
|
|
|
CASE2(BUILT_IN, BuiltInSubgroupLocalInvocationId, Kernel, SubgroupBallotKHR),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE1(BUILT_IN, BuiltInVertexIndex, Shader),
|
|
|
|
CASE1(BUILT_IN, BuiltInInstanceIndex, Shader),
|
|
|
|
// clang-format on
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
2019-09-13 18:59:02 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
|
|
|
BuiltInV1_5, EnumCapabilityTest,
|
|
|
|
Combine(
|
|
|
|
Values(SPV_ENV_UNIVERSAL_1_5),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
// SPIR-V 1.5 adds new capabilities to enable these two builtins.
|
2020-11-23 17:23:54 +00:00
|
|
|
CASE4(BUILT_IN, BuiltInLayer, Geometry, ShaderLayer,
|
|
|
|
ShaderViewportIndexLayerEXT, MeshShadingNV),
|
|
|
|
CASE4(BUILT_IN, BuiltInViewportIndex, MultiViewport,
|
|
|
|
ShaderViewportIndex, ShaderViewportIndexLayerEXT,
|
|
|
|
MeshShadingNV),
|
2019-09-13 18:59:02 +00:00
|
|
|
})));
|
|
|
|
|
2015-10-05 13:55:23 +00:00
|
|
|
// See SPIR-V Section 3.22 Selection Control
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
SelectionControl, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(SELECTION_CONTROL, SelectionControlMaskNone),
|
|
|
|
CASE0(SELECTION_CONTROL, SelectionControlFlattenMask),
|
|
|
|
CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.23 Loop Control
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
LoopControl, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(LOOP_CONTROL, LoopControlMaskNone),
|
|
|
|
CASE0(LOOP_CONTROL, LoopControlUnrollMask),
|
|
|
|
CASE0(LOOP_CONTROL, LoopControlDontUnrollMask),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-07-05 14:21:21 +00:00
|
|
|
LoopControlV11, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask),
|
|
|
|
CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2016-07-05 14:21:21 +00:00
|
|
|
|
2015-10-05 13:55:23 +00:00
|
|
|
// See SPIR-V Section 3.24 Function Control
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
FunctionControl, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(FUNCTION_CONTROL, FunctionControlMaskNone),
|
|
|
|
CASE0(FUNCTION_CONTROL, FunctionControlInlineMask),
|
|
|
|
CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask),
|
|
|
|
CASE0(FUNCTION_CONTROL, FunctionControlPureMask),
|
|
|
|
CASE0(FUNCTION_CONTROL, FunctionControlConstMask),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.25 Memory Semantics <id>
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
MemorySemantics, EnumCapabilityTest,
|
|
|
|
Combine(
|
|
|
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsMaskNone),
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireMask),
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsReleaseMask),
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsAcquireReleaseMask),
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID,
|
|
|
|
MemorySemanticsSequentiallyConsistentMask),
|
|
|
|
CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsUniformMemoryMask,
|
|
|
|
Shader),
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsSubgroupMemoryMask),
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsWorkgroupMemoryMask),
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsCrossWorkgroupMemoryMask),
|
|
|
|
CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask,
|
|
|
|
AtomicStorage), // Bug 15234
|
|
|
|
CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.26 Memory Access
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
MemoryAccess, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessMaskNone),
|
|
|
|
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask),
|
|
|
|
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask),
|
|
|
|
CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.27 Scope <id>
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2018-06-01 22:28:26 +00:00
|
|
|
Scope, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
|
|
|
|
SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(SCOPE_ID, ScopeCrossDevice),
|
|
|
|
CASE0(SCOPE_ID, ScopeDevice),
|
|
|
|
CASE0(SCOPE_ID, ScopeWorkgroup),
|
|
|
|
CASE0(SCOPE_ID, ScopeSubgroup),
|
|
|
|
CASE0(SCOPE_ID, ScopeInvocation),
|
|
|
|
CASE1(SCOPE_ID, ScopeQueueFamilyKHR, VulkanMemoryModelKHR),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.28 Group Operation
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
GroupOperation, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
2018-06-06 06:07:51 +00:00
|
|
|
CASE3(GROUP_OPERATION, GroupOperationReduce, Kernel,
|
|
|
|
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
|
|
|
CASE3(GROUP_OPERATION, GroupOperationInclusiveScan, Kernel,
|
|
|
|
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
|
|
|
CASE3(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel,
|
|
|
|
GroupNonUniformArithmetic, GroupNonUniformBallot),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.29 Kernel Enqueue Flags
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
KernelEnqueueFlags, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsNoWait, Kernel),
|
|
|
|
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel),
|
|
|
|
CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup,
|
|
|
|
Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.30 Kernel Profiling Info
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
KernelProfilingInfo, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone),
|
|
|
|
CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask,
|
|
|
|
Kernel),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
|
|
|
// See SPIR-V Section 3.31 Capability
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
CapabilityDependsOn, EnumCapabilityTest,
|
|
|
|
Combine(
|
|
|
|
Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
// clang-format off
|
|
|
|
CASE0(CAPABILITY, CapabilityMatrix),
|
|
|
|
CASE1(CAPABILITY, CapabilityShader, Matrix),
|
|
|
|
CASE1(CAPABILITY, CapabilityGeometry, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityTessellation, Shader),
|
|
|
|
CASE0(CAPABILITY, CapabilityAddresses),
|
|
|
|
CASE0(CAPABILITY, CapabilityLinkage),
|
|
|
|
CASE0(CAPABILITY, CapabilityKernel),
|
|
|
|
CASE1(CAPABILITY, CapabilityVector16, Kernel),
|
|
|
|
CASE1(CAPABILITY, CapabilityFloat16Buffer, Kernel),
|
|
|
|
CASE0(CAPABILITY, CapabilityFloat16), // Bug 15234
|
|
|
|
CASE0(CAPABILITY, CapabilityFloat64),
|
|
|
|
CASE0(CAPABILITY, CapabilityInt64),
|
|
|
|
CASE1(CAPABILITY, CapabilityInt64Atomics, Int64),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageBasic, Kernel),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageReadWrite, ImageBasic),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageMipmap, ImageBasic),
|
|
|
|
// Value 16 intentionally missing.
|
|
|
|
CASE1(CAPABILITY, CapabilityPipes, Kernel),
|
|
|
|
CASE0(CAPABILITY, CapabilityGroups),
|
|
|
|
CASE1(CAPABILITY, CapabilityDeviceEnqueue, Kernel),
|
|
|
|
CASE1(CAPABILITY, CapabilityLiteralSampler, Kernel),
|
|
|
|
CASE1(CAPABILITY, CapabilityAtomicStorage, Shader),
|
|
|
|
CASE0(CAPABILITY, CapabilityInt16),
|
|
|
|
CASE1(CAPABILITY, CapabilityTessellationPointSize, Tessellation),
|
|
|
|
CASE1(CAPABILITY, CapabilityGeometryPointSize, Geometry),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageGatherExtended, Shader),
|
|
|
|
// Value 26 intentionally missing.
|
|
|
|
CASE1(CAPABILITY, CapabilityStorageImageMultisample, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityUniformBufferArrayDynamicIndexing, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilitySampledImageArrayDynamicIndexing, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityStorageBufferArrayDynamicIndexing, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityStorageImageArrayDynamicIndexing, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityClipDistance, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityCullDistance, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageCubeArray, SampledCubeArray),
|
|
|
|
CASE1(CAPABILITY, CapabilitySampleRateShading, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageRect, SampledRect),
|
|
|
|
CASE1(CAPABILITY, CapabilitySampledRect, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityGenericPointer, Addresses),
|
2018-05-10 20:32:13 +00:00
|
|
|
CASE0(CAPABILITY, CapabilityInt8),
|
2016-04-26 16:16:00 +00:00
|
|
|
CASE1(CAPABILITY, CapabilityInputAttachment, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilitySparseResidency, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityMinLod, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityImage1D, Sampled1D),
|
|
|
|
CASE1(CAPABILITY, CapabilitySampledCubeArray, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageBuffer, SampledBuffer),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageMSArray, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityStorageImageExtendedFormats, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityImageQuery, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityDerivativeControl, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityInterpolationFunction, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityTransformFeedback, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityGeometryStreams, Geometry),
|
|
|
|
CASE1(CAPABILITY, CapabilityStorageImageReadWithoutFormat, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityStorageImageWriteWithoutFormat, Shader),
|
|
|
|
CASE1(CAPABILITY, CapabilityMultiViewport, Geometry),
|
|
|
|
// clang-format on
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2016-04-26 16:16:00 +00:00
|
|
|
|
2019-01-29 23:56:52 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
2016-04-26 16:16:00 +00:00
|
|
|
CapabilityDependsOnV11, EnumCapabilityTest,
|
|
|
|
Combine(Values(SPV_ENV_UNIVERSAL_1_1),
|
|
|
|
ValuesIn(std::vector<EnumCapabilityCase>{
|
|
|
|
CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue),
|
|
|
|
CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel),
|
|
|
|
CASE1(CAPABILITY, CapabilityPipeStorage, Pipes),
|
2019-01-29 23:56:52 +00:00
|
|
|
})));
|
2015-10-05 13:55:23 +00:00
|
|
|
|
2015-10-02 21:10:10 +00:00
|
|
|
#undef CASE0
|
|
|
|
#undef CASE1
|
|
|
|
#undef CASE2
|
|
|
|
|
2018-07-07 13:38:00 +00:00
|
|
|
} // namespace
|
|
|
|
} // namespace spvtools
|