This is a part of the effort to make libspirv.h C-compatible.
--- /dev/null
+/*
+** Copyright (c) 2014-2015 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a copy
+** of this software and/or associated documentation files (the "Materials"),
+** to deal in the Materials without restriction, including without limitation
+** the rights to use, copy, modify, merge, publish, distribute, sublicense,
+** and/or sell copies of the Materials, and to permit persons to whom the
+** Materials are furnished to do so, subject to the following conditions:
+**
+** The above copyright notice and this permission notice shall be included in
+** all copies or substantial portions of the Materials.
+**
+** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
+** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
+** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
+** IN THE MATERIALS.
+*/
+
+/*
+** This header is automatically generated by the same tool that creates
+** the Binary Section of the SPIR-V specification.
+*/
+
+/*
+** Specification revision 32.
+** Enumeration tokens for SPIR-V, in various styles:
+** C, C++, C++11, JSON, Lua, Python
+**
+** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
+** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
+** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
+** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
+** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
+**
+** Some tokens act like mask values, which can be OR'd together,
+** while others are mutually exclusive. The mask-like ones have
+** "Mask" in their name, and a parallel enum that has the shift
+** amount (1 << x) for each corresponding enumerant.
+*/
+
+#ifndef spirv_H
+#define spirv_H
+
+typedef unsigned int SpvId;
+
+static const unsigned int SpvMagicNumber = 0x07230203;
+static const unsigned int SpvVersion = 99;
+static const unsigned int SpvRevision = 32;
+static const unsigned int SpvOpCodeMask = 0xffff;
+static const unsigned int SpvWordCountShift = 16;
+
+typedef enum SpvSourceLanguage_ {
+ SpvSourceLanguageUnknown = 0,
+ SpvSourceLanguageESSL = 1,
+ SpvSourceLanguageGLSL = 2,
+ SpvSourceLanguageOpenCL = 3,
+} SpvSourceLanguage;
+
+typedef enum SpvExecutionModel_ {
+ SpvExecutionModelVertex = 0,
+ SpvExecutionModelTessellationControl = 1,
+ SpvExecutionModelTessellationEvaluation = 2,
+ SpvExecutionModelGeometry = 3,
+ SpvExecutionModelFragment = 4,
+ SpvExecutionModelGLCompute = 5,
+ SpvExecutionModelKernel = 6,
+} SpvExecutionModel;
+
+typedef enum SpvAddressingModel_ {
+ SpvAddressingModelLogical = 0,
+ SpvAddressingModelPhysical32 = 1,
+ SpvAddressingModelPhysical64 = 2,
+} SpvAddressingModel;
+
+typedef enum SpvMemoryModel_ {
+ SpvMemoryModelSimple = 0,
+ SpvMemoryModelGLSL450 = 1,
+ SpvMemoryModelOpenCL = 2,
+} SpvMemoryModel;
+
+typedef enum SpvExecutionMode_ {
+ SpvExecutionModeInvocations = 0,
+ SpvExecutionModeSpacingEqual = 1,
+ SpvExecutionModeSpacingFractionalEven = 2,
+ SpvExecutionModeSpacingFractionalOdd = 3,
+ SpvExecutionModeVertexOrderCw = 4,
+ SpvExecutionModeVertexOrderCcw = 5,
+ SpvExecutionModePixelCenterInteger = 6,
+ SpvExecutionModeOriginUpperLeft = 7,
+ SpvExecutionModeOriginLowerLeft = 8,
+ SpvExecutionModeEarlyFragmentTests = 9,
+ SpvExecutionModePointMode = 10,
+ SpvExecutionModeXfb = 11,
+ SpvExecutionModeDepthReplacing = 12,
+ SpvExecutionModeDepthAny = 13,
+ SpvExecutionModeDepthGreater = 14,
+ SpvExecutionModeDepthLess = 15,
+ SpvExecutionModeDepthUnchanged = 16,
+ SpvExecutionModeLocalSize = 17,
+ SpvExecutionModeLocalSizeHint = 18,
+ SpvExecutionModeInputPoints = 19,
+ SpvExecutionModeInputLines = 20,
+ SpvExecutionModeInputLinesAdjacency = 21,
+ SpvExecutionModeInputTriangles = 22,
+ SpvExecutionModeInputTrianglesAdjacency = 23,
+ SpvExecutionModeInputQuads = 24,
+ SpvExecutionModeInputIsolines = 25,
+ SpvExecutionModeOutputVertices = 26,
+ SpvExecutionModeOutputPoints = 27,
+ SpvExecutionModeOutputLineStrip = 28,
+ SpvExecutionModeOutputTriangleStrip = 29,
+ SpvExecutionModeVecTypeHint = 30,
+ SpvExecutionModeContractionOff = 31,
+ SpvExecutionModeIndependentForwardProgress = 32,
+} SpvExecutionMode;
+
+typedef enum SpvStorageClass_ {
+ SpvStorageClassUniformConstant = 0,
+ SpvStorageClassInput = 1,
+ SpvStorageClassUniform = 2,
+ SpvStorageClassOutput = 3,
+ SpvStorageClassWorkgroupLocal = 4,
+ SpvStorageClassWorkgroupGlobal = 5,
+ SpvStorageClassPrivateGlobal = 6,
+ SpvStorageClassFunction = 7,
+ SpvStorageClassGeneric = 8,
+ SpvStorageClassPushConstant = 9,
+ SpvStorageClassAtomicCounter = 10,
+ SpvStorageClassImage = 11,
+} SpvStorageClass;
+
+typedef enum SpvDim_ {
+ SpvDim1D = 0,
+ SpvDim2D = 1,
+ SpvDim3D = 2,
+ SpvDimCube = 3,
+ SpvDimRect = 4,
+ SpvDimBuffer = 5,
+ SpvDimInputTarget = 6,
+} SpvDim;
+
+typedef enum SpvSamplerAddressingMode_ {
+ SpvSamplerAddressingModeNone = 0,
+ SpvSamplerAddressingModeClampToEdge = 1,
+ SpvSamplerAddressingModeClamp = 2,
+ SpvSamplerAddressingModeRepeat = 3,
+ SpvSamplerAddressingModeRepeatMirrored = 4,
+} SpvSamplerAddressingMode;
+
+typedef enum SpvSamplerFilterMode_ {
+ SpvSamplerFilterModeNearest = 0,
+ SpvSamplerFilterModeLinear = 1,
+} SpvSamplerFilterMode;
+
+typedef enum SpvImageFormat_ {
+ SpvImageFormatUnknown = 0,
+ SpvImageFormatRgba32f = 1,
+ SpvImageFormatRgba16f = 2,
+ SpvImageFormatR32f = 3,
+ SpvImageFormatRgba8 = 4,
+ SpvImageFormatRgba8Snorm = 5,
+ SpvImageFormatRg32f = 6,
+ SpvImageFormatRg16f = 7,
+ SpvImageFormatR11fG11fB10f = 8,
+ SpvImageFormatR16f = 9,
+ SpvImageFormatRgba16 = 10,
+ SpvImageFormatRgb10A2 = 11,
+ SpvImageFormatRg16 = 12,
+ SpvImageFormatRg8 = 13,
+ SpvImageFormatR16 = 14,
+ SpvImageFormatR8 = 15,
+ SpvImageFormatRgba16Snorm = 16,
+ SpvImageFormatRg16Snorm = 17,
+ SpvImageFormatRg8Snorm = 18,
+ SpvImageFormatR16Snorm = 19,
+ SpvImageFormatR8Snorm = 20,
+ SpvImageFormatRgba32i = 21,
+ SpvImageFormatRgba16i = 22,
+ SpvImageFormatRgba8i = 23,
+ SpvImageFormatR32i = 24,
+ SpvImageFormatRg32i = 25,
+ SpvImageFormatRg16i = 26,
+ SpvImageFormatRg8i = 27,
+ SpvImageFormatR16i = 28,
+ SpvImageFormatR8i = 29,
+ SpvImageFormatRgba32ui = 30,
+ SpvImageFormatRgba16ui = 31,
+ SpvImageFormatRgba8ui = 32,
+ SpvImageFormatR32ui = 33,
+ SpvImageFormatRgb10a2ui = 34,
+ SpvImageFormatRg32ui = 35,
+ SpvImageFormatRg16ui = 36,
+ SpvImageFormatRg8ui = 37,
+ SpvImageFormatR16ui = 38,
+ SpvImageFormatR8ui = 39,
+} SpvImageFormat;
+
+typedef enum SpvImageChannelOrder_ {
+ SpvImageChannelOrderR = 0,
+ SpvImageChannelOrderA = 1,
+ SpvImageChannelOrderRG = 2,
+ SpvImageChannelOrderRA = 3,
+ SpvImageChannelOrderRGB = 4,
+ SpvImageChannelOrderRGBA = 5,
+ SpvImageChannelOrderBGRA = 6,
+ SpvImageChannelOrderARGB = 7,
+ SpvImageChannelOrderIntensity = 8,
+ SpvImageChannelOrderLuminance = 9,
+ SpvImageChannelOrderRx = 10,
+ SpvImageChannelOrderRGx = 11,
+ SpvImageChannelOrderRGBx = 12,
+ SpvImageChannelOrderDepth = 13,
+ SpvImageChannelOrderDepthStencil = 14,
+ SpvImageChannelOrdersRGB = 15,
+ SpvImageChannelOrdersRGBx = 16,
+ SpvImageChannelOrdersRGBA = 17,
+ SpvImageChannelOrdersBGRA = 18,
+} SpvImageChannelOrder;
+
+typedef enum SpvImageChannelDataType_ {
+ SpvImageChannelDataTypeSnormInt8 = 0,
+ SpvImageChannelDataTypeSnormInt16 = 1,
+ SpvImageChannelDataTypeUnormInt8 = 2,
+ SpvImageChannelDataTypeUnormInt16 = 3,
+ SpvImageChannelDataTypeUnormShort565 = 4,
+ SpvImageChannelDataTypeUnormShort555 = 5,
+ SpvImageChannelDataTypeUnormInt101010 = 6,
+ SpvImageChannelDataTypeSignedInt8 = 7,
+ SpvImageChannelDataTypeSignedInt16 = 8,
+ SpvImageChannelDataTypeSignedInt32 = 9,
+ SpvImageChannelDataTypeUnsignedInt8 = 10,
+ SpvImageChannelDataTypeUnsignedInt16 = 11,
+ SpvImageChannelDataTypeUnsignedInt32 = 12,
+ SpvImageChannelDataTypeHalfFloat = 13,
+ SpvImageChannelDataTypeFloat = 14,
+ SpvImageChannelDataTypeUnormInt24 = 15,
+} SpvImageChannelDataType;
+
+typedef enum SpvImageOperandsShift_ {
+ SpvImageOperandsBiasShift = 0,
+ SpvImageOperandsLodShift = 1,
+ SpvImageOperandsGradShift = 2,
+ SpvImageOperandsConstOffsetShift = 3,
+ SpvImageOperandsOffsetShift = 4,
+ SpvImageOperandsConstOffsetsShift = 5,
+ SpvImageOperandsSampleShift = 6,
+ SpvImageOperandsMinLodShift = 7,
+} SpvImageOperandsShift;
+
+typedef enum SpvImageOperandsMask_ {
+ SpvImageOperandsMaskNone = 0,
+ SpvImageOperandsBiasMask = 0x00000001,
+ SpvImageOperandsLodMask = 0x00000002,
+ SpvImageOperandsGradMask = 0x00000004,
+ SpvImageOperandsConstOffsetMask = 0x00000008,
+ SpvImageOperandsOffsetMask = 0x00000010,
+ SpvImageOperandsConstOffsetsMask = 0x00000020,
+ SpvImageOperandsSampleMask = 0x00000040,
+ SpvImageOperandsMinLodMask = 0x00000080,
+} SpvImageOperandsMask;
+
+typedef enum SpvFPFastMathModeShift_ {
+ SpvFPFastMathModeNotNaNShift = 0,
+ SpvFPFastMathModeNotInfShift = 1,
+ SpvFPFastMathModeNSZShift = 2,
+ SpvFPFastMathModeAllowRecipShift = 3,
+ SpvFPFastMathModeFastShift = 4,
+} SpvFPFastMathModeShift;
+
+typedef enum SpvFPFastMathModeMask_ {
+ SpvFPFastMathModeMaskNone = 0,
+ SpvFPFastMathModeNotNaNMask = 0x00000001,
+ SpvFPFastMathModeNotInfMask = 0x00000002,
+ SpvFPFastMathModeNSZMask = 0x00000004,
+ SpvFPFastMathModeAllowRecipMask = 0x00000008,
+ SpvFPFastMathModeFastMask = 0x00000010,
+} SpvFPFastMathModeMask;
+
+typedef enum SpvFPRoundingMode_ {
+ SpvFPRoundingModeRTE = 0,
+ SpvFPRoundingModeRTZ = 1,
+ SpvFPRoundingModeRTP = 2,
+ SpvFPRoundingModeRTN = 3,
+} SpvFPRoundingMode;
+
+typedef enum SpvLinkageType_ {
+ SpvLinkageTypeExport = 0,
+ SpvLinkageTypeImport = 1,
+} SpvLinkageType;
+
+typedef enum SpvAccessQualifier_ {
+ SpvAccessQualifierReadOnly = 0,
+ SpvAccessQualifierWriteOnly = 1,
+ SpvAccessQualifierReadWrite = 2,
+} SpvAccessQualifier;
+
+typedef enum SpvFunctionParameterAttribute_ {
+ SpvFunctionParameterAttributeZext = 0,
+ SpvFunctionParameterAttributeSext = 1,
+ SpvFunctionParameterAttributeByVal = 2,
+ SpvFunctionParameterAttributeSret = 3,
+ SpvFunctionParameterAttributeNoAlias = 4,
+ SpvFunctionParameterAttributeNoCapture = 5,
+ SpvFunctionParameterAttributeNoWrite = 6,
+ SpvFunctionParameterAttributeNoReadWrite = 7,
+} SpvFunctionParameterAttribute;
+
+typedef enum SpvDecoration_ {
+ SpvDecorationRelaxedPrecision = 0,
+ SpvDecorationSpecId = 1,
+ SpvDecorationBlock = 2,
+ SpvDecorationBufferBlock = 3,
+ SpvDecorationRowMajor = 4,
+ SpvDecorationColMajor = 5,
+ SpvDecorationArrayStride = 6,
+ SpvDecorationMatrixStride = 7,
+ SpvDecorationGLSLShared = 8,
+ SpvDecorationGLSLPacked = 9,
+ SpvDecorationCPacked = 10,
+ SpvDecorationBuiltIn = 11,
+ SpvDecorationSmooth = 12,
+ SpvDecorationNoPerspective = 13,
+ SpvDecorationFlat = 14,
+ SpvDecorationPatch = 15,
+ SpvDecorationCentroid = 16,
+ SpvDecorationSample = 17,
+ SpvDecorationInvariant = 18,
+ SpvDecorationRestrict = 19,
+ SpvDecorationAliased = 20,
+ SpvDecorationVolatile = 21,
+ SpvDecorationConstant = 22,
+ SpvDecorationCoherent = 23,
+ SpvDecorationNonWritable = 24,
+ SpvDecorationNonReadable = 25,
+ SpvDecorationUniform = 26,
+ SpvDecorationSaturatedConversion = 28,
+ SpvDecorationStream = 29,
+ SpvDecorationLocation = 30,
+ SpvDecorationComponent = 31,
+ SpvDecorationIndex = 32,
+ SpvDecorationBinding = 33,
+ SpvDecorationDescriptorSet = 34,
+ SpvDecorationOffset = 35,
+ SpvDecorationXfbBuffer = 36,
+ SpvDecorationXfbStride = 37,
+ SpvDecorationFuncParamAttr = 38,
+ SpvDecorationFPRoundingMode = 39,
+ SpvDecorationFPFastMathMode = 40,
+ SpvDecorationLinkageAttributes = 41,
+ SpvDecorationNoContraction = 42,
+ SpvDecorationInputTargetIndex = 43,
+ SpvDecorationAlignment = 44,
+} SpvDecoration;
+
+typedef enum SpvBuiltIn_ {
+ SpvBuiltInPosition = 0,
+ SpvBuiltInPointSize = 1,
+ SpvBuiltInClipDistance = 3,
+ SpvBuiltInCullDistance = 4,
+ SpvBuiltInVertexId = 5,
+ SpvBuiltInInstanceId = 6,
+ SpvBuiltInPrimitiveId = 7,
+ SpvBuiltInInvocationId = 8,
+ SpvBuiltInLayer = 9,
+ SpvBuiltInViewportIndex = 10,
+ SpvBuiltInTessLevelOuter = 11,
+ SpvBuiltInTessLevelInner = 12,
+ SpvBuiltInTessCoord = 13,
+ SpvBuiltInPatchVertices = 14,
+ SpvBuiltInFragCoord = 15,
+ SpvBuiltInPointCoord = 16,
+ SpvBuiltInFrontFacing = 17,
+ SpvBuiltInSampleId = 18,
+ SpvBuiltInSamplePosition = 19,
+ SpvBuiltInSampleMask = 20,
+ SpvBuiltInFragColor = 21,
+ SpvBuiltInFragDepth = 22,
+ SpvBuiltInHelperInvocation = 23,
+ SpvBuiltInNumWorkgroups = 24,
+ SpvBuiltInWorkgroupSize = 25,
+ SpvBuiltInWorkgroupId = 26,
+ SpvBuiltInLocalInvocationId = 27,
+ SpvBuiltInGlobalInvocationId = 28,
+ SpvBuiltInLocalInvocationIndex = 29,
+ SpvBuiltInWorkDim = 30,
+ SpvBuiltInGlobalSize = 31,
+ SpvBuiltInEnqueuedWorkgroupSize = 32,
+ SpvBuiltInGlobalOffset = 33,
+ SpvBuiltInGlobalLinearId = 34,
+ SpvBuiltInWorkgroupLinearId = 35,
+ SpvBuiltInSubgroupSize = 36,
+ SpvBuiltInSubgroupMaxSize = 37,
+ SpvBuiltInNumSubgroups = 38,
+ SpvBuiltInNumEnqueuedSubgroups = 39,
+ SpvBuiltInSubgroupId = 40,
+ SpvBuiltInSubgroupLocalInvocationId = 41,
+ SpvBuiltInVertexIndex = 42,
+ SpvBuiltInInstanceIndex = 43,
+} SpvBuiltIn;
+
+typedef enum SpvSelectionControlShift_ {
+ SpvSelectionControlFlattenShift = 0,
+ SpvSelectionControlDontFlattenShift = 1,
+} SpvSelectionControlShift;
+
+typedef enum SpvSelectionControlMask_ {
+ SpvSelectionControlMaskNone = 0,
+ SpvSelectionControlFlattenMask = 0x00000001,
+ SpvSelectionControlDontFlattenMask = 0x00000002,
+} SpvSelectionControlMask;
+
+typedef enum SpvLoopControlShift_ {
+ SpvLoopControlUnrollShift = 0,
+ SpvLoopControlDontUnrollShift = 1,
+} SpvLoopControlShift;
+
+typedef enum SpvLoopControlMask_ {
+ SpvLoopControlMaskNone = 0,
+ SpvLoopControlUnrollMask = 0x00000001,
+ SpvLoopControlDontUnrollMask = 0x00000002,
+} SpvLoopControlMask;
+
+typedef enum SpvFunctionControlShift_ {
+ SpvFunctionControlInlineShift = 0,
+ SpvFunctionControlDontInlineShift = 1,
+ SpvFunctionControlPureShift = 2,
+ SpvFunctionControlConstShift = 3,
+} SpvFunctionControlShift;
+
+typedef enum SpvFunctionControlMask_ {
+ SpvFunctionControlMaskNone = 0,
+ SpvFunctionControlInlineMask = 0x00000001,
+ SpvFunctionControlDontInlineMask = 0x00000002,
+ SpvFunctionControlPureMask = 0x00000004,
+ SpvFunctionControlConstMask = 0x00000008,
+} SpvFunctionControlMask;
+
+typedef enum SpvMemorySemanticsShift_ {
+ SpvMemorySemanticsAcquireShift = 0,
+ SpvMemorySemanticsReleaseShift = 1,
+ SpvMemorySemanticsSequentiallyConsistentShift = 2,
+ SpvMemorySemanticsUniformMemoryShift = 3,
+ SpvMemorySemanticsSubgroupMemoryShift = 4,
+ SpvMemorySemanticsWorkgroupLocalMemoryShift = 5,
+ SpvMemorySemanticsWorkgroupGlobalMemoryShift = 6,
+ SpvMemorySemanticsAtomicCounterMemoryShift = 7,
+ SpvMemorySemanticsImageMemoryShift = 8,
+} SpvMemorySemanticsShift;
+
+typedef enum SpvMemorySemanticsMask_ {
+ SpvMemorySemanticsMaskNone = 0,
+ SpvMemorySemanticsAcquireMask = 0x00000001,
+ SpvMemorySemanticsReleaseMask = 0x00000002,
+ SpvMemorySemanticsSequentiallyConsistentMask = 0x00000004,
+ SpvMemorySemanticsUniformMemoryMask = 0x00000008,
+ SpvMemorySemanticsSubgroupMemoryMask = 0x00000010,
+ SpvMemorySemanticsWorkgroupLocalMemoryMask = 0x00000020,
+ SpvMemorySemanticsWorkgroupGlobalMemoryMask = 0x00000040,
+ SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000080,
+ SpvMemorySemanticsImageMemoryMask = 0x00000100,
+} SpvMemorySemanticsMask;
+
+typedef enum SpvMemoryAccessShift_ {
+ SpvMemoryAccessVolatileShift = 0,
+ SpvMemoryAccessAlignedShift = 1,
+ SpvMemoryAccessNontemporalShift = 2,
+} SpvMemoryAccessShift;
+
+typedef enum SpvMemoryAccessMask_ {
+ SpvMemoryAccessMaskNone = 0,
+ SpvMemoryAccessVolatileMask = 0x00000001,
+ SpvMemoryAccessAlignedMask = 0x00000002,
+ SpvMemoryAccessNontemporalMask = 0x00000004,
+} SpvMemoryAccessMask;
+
+typedef enum SpvScope_ {
+ SpvScopeCrossDevice = 0,
+ SpvScopeDevice = 1,
+ SpvScopeWorkgroup = 2,
+ SpvScopeSubgroup = 3,
+ SpvScopeInvocation = 4,
+} SpvScope;
+
+typedef enum SpvGroupOperation_ {
+ SpvGroupOperationReduce = 0,
+ SpvGroupOperationInclusiveScan = 1,
+ SpvGroupOperationExclusiveScan = 2,
+} SpvGroupOperation;
+
+typedef enum SpvKernelEnqueueFlags_ {
+ SpvKernelEnqueueFlagsNoWait = 0,
+ SpvKernelEnqueueFlagsWaitKernel = 1,
+ SpvKernelEnqueueFlagsWaitWorkGroup = 2,
+} SpvKernelEnqueueFlags;
+
+typedef enum SpvKernelProfilingInfoShift_ {
+ SpvKernelProfilingInfoCmdExecTimeShift = 0,
+} SpvKernelProfilingInfoShift;
+
+typedef enum SpvKernelProfilingInfoMask_ {
+ SpvKernelProfilingInfoMaskNone = 0,
+ SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001,
+} SpvKernelProfilingInfoMask;
+
+typedef enum SpvCapability_ {
+ SpvCapabilityMatrix = 0,
+ SpvCapabilityShader = 1,
+ SpvCapabilityGeometry = 2,
+ SpvCapabilityTessellation = 3,
+ SpvCapabilityAddresses = 4,
+ SpvCapabilityLinkage = 5,
+ SpvCapabilityKernel = 6,
+ SpvCapabilityVector16 = 7,
+ SpvCapabilityFloat16Buffer = 8,
+ SpvCapabilityFloat16 = 9,
+ SpvCapabilityFloat64 = 10,
+ SpvCapabilityInt64 = 11,
+ SpvCapabilityInt64Atomics = 12,
+ SpvCapabilityImageBasic = 13,
+ SpvCapabilityImageReadWrite = 14,
+ SpvCapabilityImageMipmap = 15,
+ SpvCapabilityImageSRGBWrite = 16,
+ SpvCapabilityPipes = 17,
+ SpvCapabilityGroups = 18,
+ SpvCapabilityDeviceEnqueue = 19,
+ SpvCapabilityLiteralSampler = 20,
+ SpvCapabilityAtomicStorage = 21,
+ SpvCapabilityInt16 = 22,
+ SpvCapabilityTessellationPointSize = 23,
+ SpvCapabilityGeometryPointSize = 24,
+ SpvCapabilityImageGatherExtended = 25,
+ SpvCapabilityStorageImageExtendedFormats = 26,
+ SpvCapabilityStorageImageMultisample = 27,
+ SpvCapabilityUniformBufferArrayDynamicIndexing = 28,
+ SpvCapabilitySampledImageArrayDynamicIndexing = 29,
+ SpvCapabilityStorageBufferArrayDynamicIndexing = 30,
+ SpvCapabilityStorageImageArrayDynamicIndexing = 31,
+ SpvCapabilityClipDistance = 32,
+ SpvCapabilityCullDistance = 33,
+ SpvCapabilityImageCubeArray = 34,
+ SpvCapabilitySampleRateShading = 35,
+ SpvCapabilityImageRect = 36,
+ SpvCapabilitySampledRect = 37,
+ SpvCapabilityGenericPointer = 38,
+ SpvCapabilityInt8 = 39,
+ SpvCapabilityInputTarget = 40,
+ SpvCapabilitySparseResidency = 41,
+ SpvCapabilityMinLod = 42,
+ SpvCapabilitySampled1D = 43,
+ SpvCapabilityImage1D = 44,
+ SpvCapabilitySampledCubeArray = 45,
+ SpvCapabilitySampledBuffer = 46,
+ SpvCapabilityImageBuffer = 47,
+ SpvCapabilityImageMSArray = 48,
+ SpvCapabilityAdvancedFormats = 49,
+ SpvCapabilityImageQuery = 50,
+ SpvCapabilityDerivativeControl = 51,
+ SpvCapabilityInterpolationFunction = 52,
+ SpvCapabilityTransformFeedback = 53,
+} SpvCapability;
+
+typedef enum SpvOp_ {
+ SpvOpNop = 0,
+ SpvOpUndef = 1,
+ SpvOpSourceContinued = 2,
+ SpvOpSource = 3,
+ SpvOpSourceExtension = 4,
+ SpvOpName = 5,
+ SpvOpMemberName = 6,
+ SpvOpString = 7,
+ SpvOpLine = 8,
+ SpvOpExtension = 10,
+ SpvOpExtInstImport = 11,
+ SpvOpExtInst = 12,
+ SpvOpMemoryModel = 14,
+ SpvOpEntryPoint = 15,
+ SpvOpExecutionMode = 16,
+ SpvOpCapability = 17,
+ SpvOpTypeVoid = 19,
+ SpvOpTypeBool = 20,
+ SpvOpTypeInt = 21,
+ SpvOpTypeFloat = 22,
+ SpvOpTypeVector = 23,
+ SpvOpTypeMatrix = 24,
+ SpvOpTypeImage = 25,
+ SpvOpTypeSampler = 26,
+ SpvOpTypeSampledImage = 27,
+ SpvOpTypeArray = 28,
+ SpvOpTypeRuntimeArray = 29,
+ SpvOpTypeStruct = 30,
+ SpvOpTypeOpaque = 31,
+ SpvOpTypePointer = 32,
+ SpvOpTypeFunction = 33,
+ SpvOpTypeEvent = 34,
+ SpvOpTypeDeviceEvent = 35,
+ SpvOpTypeReserveId = 36,
+ SpvOpTypeQueue = 37,
+ SpvOpTypePipe = 38,
+ SpvOpTypeForwardPointer = 39,
+ SpvOpConstantTrue = 41,
+ SpvOpConstantFalse = 42,
+ SpvOpConstant = 43,
+ SpvOpConstantComposite = 44,
+ SpvOpConstantSampler = 45,
+ SpvOpConstantNull = 46,
+ SpvOpSpecConstantTrue = 48,
+ SpvOpSpecConstantFalse = 49,
+ SpvOpSpecConstant = 50,
+ SpvOpSpecConstantComposite = 51,
+ SpvOpSpecConstantOp = 52,
+ SpvOpFunction = 54,
+ SpvOpFunctionParameter = 55,
+ SpvOpFunctionEnd = 56,
+ SpvOpFunctionCall = 57,
+ SpvOpVariable = 59,
+ SpvOpImageTexelPointer = 60,
+ SpvOpLoad = 61,
+ SpvOpStore = 62,
+ SpvOpCopyMemory = 63,
+ SpvOpCopyMemorySized = 64,
+ SpvOpAccessChain = 65,
+ SpvOpInBoundsAccessChain = 66,
+ SpvOpPtrAccessChain = 67,
+ SpvOpArrayLength = 68,
+ SpvOpGenericPtrMemSemantics = 69,
+ SpvOpInBoundsPtrAccessChain = 70,
+ SpvOpDecorate = 71,
+ SpvOpMemberDecorate = 72,
+ SpvOpDecorationGroup = 73,
+ SpvOpGroupDecorate = 74,
+ SpvOpGroupMemberDecorate = 75,
+ SpvOpVectorExtractDynamic = 77,
+ SpvOpVectorInsertDynamic = 78,
+ SpvOpVectorShuffle = 79,
+ SpvOpCompositeConstruct = 80,
+ SpvOpCompositeExtract = 81,
+ SpvOpCompositeInsert = 82,
+ SpvOpCopyObject = 83,
+ SpvOpTranspose = 84,
+ SpvOpSampledImage = 86,
+ SpvOpImageSampleImplicitLod = 87,
+ SpvOpImageSampleExplicitLod = 88,
+ SpvOpImageSampleDrefImplicitLod = 89,
+ SpvOpImageSampleDrefExplicitLod = 90,
+ SpvOpImageSampleProjImplicitLod = 91,
+ SpvOpImageSampleProjExplicitLod = 92,
+ SpvOpImageSampleProjDrefImplicitLod = 93,
+ SpvOpImageSampleProjDrefExplicitLod = 94,
+ SpvOpImageFetch = 95,
+ SpvOpImageGather = 96,
+ SpvOpImageDrefGather = 97,
+ SpvOpImageRead = 98,
+ SpvOpImageWrite = 99,
+ SpvOpImageQueryFormat = 101,
+ SpvOpImageQueryOrder = 102,
+ SpvOpImageQuerySizeLod = 103,
+ SpvOpImageQuerySize = 104,
+ SpvOpImageQueryLod = 105,
+ SpvOpImageQueryLevels = 106,
+ SpvOpImageQuerySamples = 107,
+ SpvOpConvertFToU = 109,
+ SpvOpConvertFToS = 110,
+ SpvOpConvertSToF = 111,
+ SpvOpConvertUToF = 112,
+ SpvOpUConvert = 113,
+ SpvOpSConvert = 114,
+ SpvOpFConvert = 115,
+ SpvOpQuantizeToF16 = 116,
+ SpvOpConvertPtrToU = 117,
+ SpvOpSatConvertSToU = 118,
+ SpvOpSatConvertUToS = 119,
+ SpvOpConvertUToPtr = 120,
+ SpvOpPtrCastToGeneric = 121,
+ SpvOpGenericCastToPtr = 122,
+ SpvOpGenericCastToPtrExplicit = 123,
+ SpvOpBitcast = 124,
+ SpvOpSNegate = 126,
+ SpvOpFNegate = 127,
+ SpvOpIAdd = 128,
+ SpvOpFAdd = 129,
+ SpvOpISub = 130,
+ SpvOpFSub = 131,
+ SpvOpIMul = 132,
+ SpvOpFMul = 133,
+ SpvOpUDiv = 134,
+ SpvOpSDiv = 135,
+ SpvOpFDiv = 136,
+ SpvOpUMod = 137,
+ SpvOpSRem = 138,
+ SpvOpSMod = 139,
+ SpvOpFRem = 140,
+ SpvOpFMod = 141,
+ SpvOpVectorTimesScalar = 142,
+ SpvOpMatrixTimesScalar = 143,
+ SpvOpVectorTimesMatrix = 144,
+ SpvOpMatrixTimesVector = 145,
+ SpvOpMatrixTimesMatrix = 146,
+ SpvOpOuterProduct = 147,
+ SpvOpDot = 148,
+ SpvOpIAddCarry = 149,
+ SpvOpISubBorrow = 150,
+ SpvOpUMulExtended = 151,
+ SpvOpSMulExtended = 152,
+ SpvOpAny = 154,
+ SpvOpAll = 155,
+ SpvOpIsNan = 156,
+ SpvOpIsInf = 157,
+ SpvOpIsFinite = 158,
+ SpvOpIsNormal = 159,
+ SpvOpSignBitSet = 160,
+ SpvOpLessOrGreater = 161,
+ SpvOpOrdered = 162,
+ SpvOpUnordered = 163,
+ SpvOpLogicalEqual = 164,
+ SpvOpLogicalNotEqual = 165,
+ SpvOpLogicalOr = 166,
+ SpvOpLogicalAnd = 167,
+ SpvOpLogicalNot = 168,
+ SpvOpSelect = 169,
+ SpvOpIEqual = 170,
+ SpvOpINotEqual = 171,
+ SpvOpUGreaterThan = 172,
+ SpvOpSGreaterThan = 173,
+ SpvOpUGreaterThanEqual = 174,
+ SpvOpSGreaterThanEqual = 175,
+ SpvOpULessThan = 176,
+ SpvOpSLessThan = 177,
+ SpvOpULessThanEqual = 178,
+ SpvOpSLessThanEqual = 179,
+ SpvOpFOrdEqual = 180,
+ SpvOpFUnordEqual = 181,
+ SpvOpFOrdNotEqual = 182,
+ SpvOpFUnordNotEqual = 183,
+ SpvOpFOrdLessThan = 184,
+ SpvOpFUnordLessThan = 185,
+ SpvOpFOrdGreaterThan = 186,
+ SpvOpFUnordGreaterThan = 187,
+ SpvOpFOrdLessThanEqual = 188,
+ SpvOpFUnordLessThanEqual = 189,
+ SpvOpFOrdGreaterThanEqual = 190,
+ SpvOpFUnordGreaterThanEqual = 191,
+ SpvOpShiftRightLogical = 194,
+ SpvOpShiftRightArithmetic = 195,
+ SpvOpShiftLeftLogical = 196,
+ SpvOpBitwiseOr = 197,
+ SpvOpBitwiseXor = 198,
+ SpvOpBitwiseAnd = 199,
+ SpvOpNot = 200,
+ SpvOpBitFieldInsert = 201,
+ SpvOpBitFieldSExtract = 202,
+ SpvOpBitFieldUExtract = 203,
+ SpvOpBitReverse = 204,
+ SpvOpBitCount = 205,
+ SpvOpDPdx = 207,
+ SpvOpDPdy = 208,
+ SpvOpFwidth = 209,
+ SpvOpDPdxFine = 210,
+ SpvOpDPdyFine = 211,
+ SpvOpFwidthFine = 212,
+ SpvOpDPdxCoarse = 213,
+ SpvOpDPdyCoarse = 214,
+ SpvOpFwidthCoarse = 215,
+ SpvOpEmitVertex = 218,
+ SpvOpEndPrimitive = 219,
+ SpvOpEmitStreamVertex = 220,
+ SpvOpEndStreamPrimitive = 221,
+ SpvOpControlBarrier = 224,
+ SpvOpMemoryBarrier = 225,
+ SpvOpAtomicLoad = 227,
+ SpvOpAtomicStore = 228,
+ SpvOpAtomicExchange = 229,
+ SpvOpAtomicCompareExchange = 230,
+ SpvOpAtomicCompareExchangeWeak = 231,
+ SpvOpAtomicIIncrement = 232,
+ SpvOpAtomicIDecrement = 233,
+ SpvOpAtomicIAdd = 234,
+ SpvOpAtomicISub = 235,
+ SpvOpAtomicSMin = 236,
+ SpvOpAtomicUMin = 237,
+ SpvOpAtomicSMax = 238,
+ SpvOpAtomicUMax = 239,
+ SpvOpAtomicAnd = 240,
+ SpvOpAtomicOr = 241,
+ SpvOpAtomicXor = 242,
+ SpvOpPhi = 245,
+ SpvOpLoopMerge = 246,
+ SpvOpSelectionMerge = 247,
+ SpvOpLabel = 248,
+ SpvOpBranch = 249,
+ SpvOpBranchConditional = 250,
+ SpvOpSwitch = 251,
+ SpvOpKill = 252,
+ SpvOpReturn = 253,
+ SpvOpReturnValue = 254,
+ SpvOpUnreachable = 255,
+ SpvOpLifetimeStart = 256,
+ SpvOpLifetimeStop = 257,
+ SpvOpAsyncGroupCopy = 259,
+ SpvOpWaitGroupEvents = 260,
+ SpvOpGroupAll = 261,
+ SpvOpGroupAny = 262,
+ SpvOpGroupBroadcast = 263,
+ SpvOpGroupIAdd = 264,
+ SpvOpGroupFAdd = 265,
+ SpvOpGroupFMin = 266,
+ SpvOpGroupUMin = 267,
+ SpvOpGroupSMin = 268,
+ SpvOpGroupFMax = 269,
+ SpvOpGroupUMax = 270,
+ SpvOpGroupSMax = 271,
+ SpvOpReadPipe = 274,
+ SpvOpWritePipe = 275,
+ SpvOpReservedReadPipe = 276,
+ SpvOpReservedWritePipe = 277,
+ SpvOpReserveReadPipePackets = 278,
+ SpvOpReserveWritePipePackets = 279,
+ SpvOpCommitReadPipe = 280,
+ SpvOpCommitWritePipe = 281,
+ SpvOpIsValidReserveId = 282,
+ SpvOpGetNumPipePackets = 283,
+ SpvOpGetMaxPipePackets = 284,
+ SpvOpGroupReserveReadPipePackets = 285,
+ SpvOpGroupReserveWritePipePackets = 286,
+ SpvOpGroupCommitReadPipe = 287,
+ SpvOpGroupCommitWritePipe = 288,
+ SpvOpEnqueueMarker = 291,
+ SpvOpEnqueueKernel = 292,
+ SpvOpGetKernelNDrangeSubGroupCount = 293,
+ SpvOpGetKernelNDrangeMaxSubGroupSize = 294,
+ SpvOpGetKernelWorkGroupSize = 295,
+ SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296,
+ SpvOpRetainEvent = 297,
+ SpvOpReleaseEvent = 298,
+ SpvOpCreateUserEvent = 299,
+ SpvOpIsValidEvent = 300,
+ SpvOpSetUserEventStatus = 301,
+ SpvOpCaptureEventProfilingInfo = 302,
+ SpvOpGetDefaultQueue = 303,
+ SpvOpBuildNDRange = 304,
+ SpvOpImageSparseSampleImplicitLod = 305,
+ SpvOpImageSparseSampleExplicitLod = 306,
+ SpvOpImageSparseSampleDrefImplicitLod = 307,
+ SpvOpImageSparseSampleDrefExplicitLod = 308,
+ SpvOpImageSparseSampleProjImplicitLod = 309,
+ SpvOpImageSparseSampleProjExplicitLod = 310,
+ SpvOpImageSparseSampleProjDrefImplicitLod = 311,
+ SpvOpImageSparseSampleProjDrefExplicitLod = 312,
+ SpvOpImageSparseFetch = 313,
+ SpvOpImageSparseGather = 314,
+ SpvOpImageSparseDrefGather = 315,
+ SpvOpImageSparseTexelsResident = 316,
+ SpvOpNoLine = 317,
+ SpvOpAtomicFlagTestAndSet = 318,
+ SpvOpAtomicFlagClear = 319,
+} SpvOp;
+
+#endif // #ifndef spirv_H
+
+++ /dev/null
-// Copyright (c) 2014-2015 The Khronos Group Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and/or associated documentation files (the "Materials"),
-// to deal in the Materials without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Materials, and to permit persons to whom the
-// Materials are furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Materials.
-//
-// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
-// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
-// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
-//
-// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
-// IN THE MATERIALS.
-
-// This header is automatically generated by the same tool that creates
-// the Binary Section of the SPIR-V specification.
-
-// Specification revision 32.
-// Enumeration tokens for SPIR-V, in various styles:
-// C, C++, C++11, JSON, Lua, Python
-//
-// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
-// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
-// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
-// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
-// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
-//
-// Some tokens act like mask values, which can be OR'd together,
-// while others are mutually exclusive. The mask-like ones have
-// "Mask" in their name, and a parallel enum that has the shift
-// amount (1 << x) for each corresponding enumerant.
-
-#ifndef spirv_H
-#define spirv_H
-
-namespace spv {
-
-typedef unsigned int Id;
-
-static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 99;
-static const unsigned int Revision = 32;
-static const unsigned int OpCodeMask = 0xffff;
-static const unsigned int WordCountShift = 16;
-
-enum SourceLanguage {
- SourceLanguageUnknown = 0,
- SourceLanguageESSL = 1,
- SourceLanguageGLSL = 2,
- SourceLanguageOpenCL = 3,
-};
-
-enum ExecutionModel {
- ExecutionModelVertex = 0,
- ExecutionModelTessellationControl = 1,
- ExecutionModelTessellationEvaluation = 2,
- ExecutionModelGeometry = 3,
- ExecutionModelFragment = 4,
- ExecutionModelGLCompute = 5,
- ExecutionModelKernel = 6,
-};
-
-enum AddressingModel {
- AddressingModelLogical = 0,
- AddressingModelPhysical32 = 1,
- AddressingModelPhysical64 = 2,
-};
-
-enum MemoryModel {
- MemoryModelSimple = 0,
- MemoryModelGLSL450 = 1,
- MemoryModelOpenCL = 2,
-};
-
-enum ExecutionMode {
- ExecutionModeInvocations = 0,
- ExecutionModeSpacingEqual = 1,
- ExecutionModeSpacingFractionalEven = 2,
- ExecutionModeSpacingFractionalOdd = 3,
- ExecutionModeVertexOrderCw = 4,
- ExecutionModeVertexOrderCcw = 5,
- ExecutionModePixelCenterInteger = 6,
- ExecutionModeOriginUpperLeft = 7,
- ExecutionModeOriginLowerLeft = 8,
- ExecutionModeEarlyFragmentTests = 9,
- ExecutionModePointMode = 10,
- ExecutionModeXfb = 11,
- ExecutionModeDepthReplacing = 12,
- ExecutionModeDepthAny = 13,
- ExecutionModeDepthGreater = 14,
- ExecutionModeDepthLess = 15,
- ExecutionModeDepthUnchanged = 16,
- ExecutionModeLocalSize = 17,
- ExecutionModeLocalSizeHint = 18,
- ExecutionModeInputPoints = 19,
- ExecutionModeInputLines = 20,
- ExecutionModeInputLinesAdjacency = 21,
- ExecutionModeInputTriangles = 22,
- ExecutionModeInputTrianglesAdjacency = 23,
- ExecutionModeInputQuads = 24,
- ExecutionModeInputIsolines = 25,
- ExecutionModeOutputVertices = 26,
- ExecutionModeOutputPoints = 27,
- ExecutionModeOutputLineStrip = 28,
- ExecutionModeOutputTriangleStrip = 29,
- ExecutionModeVecTypeHint = 30,
- ExecutionModeContractionOff = 31,
- ExecutionModeIndependentForwardProgress = 32,
-};
-
-enum StorageClass {
- StorageClassUniformConstant = 0,
- StorageClassInput = 1,
- StorageClassUniform = 2,
- StorageClassOutput = 3,
- StorageClassWorkgroupLocal = 4,
- StorageClassWorkgroupGlobal = 5,
- StorageClassPrivateGlobal = 6,
- StorageClassFunction = 7,
- StorageClassGeneric = 8,
- StorageClassPushConstant = 9,
- StorageClassAtomicCounter = 10,
- StorageClassImage = 11,
-};
-
-enum Dim {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- DimCube = 3,
- DimRect = 4,
- DimBuffer = 5,
- DimInputTarget = 6,
-};
-
-enum SamplerAddressingMode {
- SamplerAddressingModeNone = 0,
- SamplerAddressingModeClampToEdge = 1,
- SamplerAddressingModeClamp = 2,
- SamplerAddressingModeRepeat = 3,
- SamplerAddressingModeRepeatMirrored = 4,
-};
-
-enum SamplerFilterMode {
- SamplerFilterModeNearest = 0,
- SamplerFilterModeLinear = 1,
-};
-
-enum ImageFormat {
- ImageFormatUnknown = 0,
- ImageFormatRgba32f = 1,
- ImageFormatRgba16f = 2,
- ImageFormatR32f = 3,
- ImageFormatRgba8 = 4,
- ImageFormatRgba8Snorm = 5,
- ImageFormatRg32f = 6,
- ImageFormatRg16f = 7,
- ImageFormatR11fG11fB10f = 8,
- ImageFormatR16f = 9,
- ImageFormatRgba16 = 10,
- ImageFormatRgb10A2 = 11,
- ImageFormatRg16 = 12,
- ImageFormatRg8 = 13,
- ImageFormatR16 = 14,
- ImageFormatR8 = 15,
- ImageFormatRgba16Snorm = 16,
- ImageFormatRg16Snorm = 17,
- ImageFormatRg8Snorm = 18,
- ImageFormatR16Snorm = 19,
- ImageFormatR8Snorm = 20,
- ImageFormatRgba32i = 21,
- ImageFormatRgba16i = 22,
- ImageFormatRgba8i = 23,
- ImageFormatR32i = 24,
- ImageFormatRg32i = 25,
- ImageFormatRg16i = 26,
- ImageFormatRg8i = 27,
- ImageFormatR16i = 28,
- ImageFormatR8i = 29,
- ImageFormatRgba32ui = 30,
- ImageFormatRgba16ui = 31,
- ImageFormatRgba8ui = 32,
- ImageFormatR32ui = 33,
- ImageFormatRgb10a2ui = 34,
- ImageFormatRg32ui = 35,
- ImageFormatRg16ui = 36,
- ImageFormatRg8ui = 37,
- ImageFormatR16ui = 38,
- ImageFormatR8ui = 39,
-};
-
-enum ImageChannelOrder {
- ImageChannelOrderR = 0,
- ImageChannelOrderA = 1,
- ImageChannelOrderRG = 2,
- ImageChannelOrderRA = 3,
- ImageChannelOrderRGB = 4,
- ImageChannelOrderRGBA = 5,
- ImageChannelOrderBGRA = 6,
- ImageChannelOrderARGB = 7,
- ImageChannelOrderIntensity = 8,
- ImageChannelOrderLuminance = 9,
- ImageChannelOrderRx = 10,
- ImageChannelOrderRGx = 11,
- ImageChannelOrderRGBx = 12,
- ImageChannelOrderDepth = 13,
- ImageChannelOrderDepthStencil = 14,
- ImageChannelOrdersRGB = 15,
- ImageChannelOrdersRGBx = 16,
- ImageChannelOrdersRGBA = 17,
- ImageChannelOrdersBGRA = 18,
-};
-
-enum ImageChannelDataType {
- ImageChannelDataTypeSnormInt8 = 0,
- ImageChannelDataTypeSnormInt16 = 1,
- ImageChannelDataTypeUnormInt8 = 2,
- ImageChannelDataTypeUnormInt16 = 3,
- ImageChannelDataTypeUnormShort565 = 4,
- ImageChannelDataTypeUnormShort555 = 5,
- ImageChannelDataTypeUnormInt101010 = 6,
- ImageChannelDataTypeSignedInt8 = 7,
- ImageChannelDataTypeSignedInt16 = 8,
- ImageChannelDataTypeSignedInt32 = 9,
- ImageChannelDataTypeUnsignedInt8 = 10,
- ImageChannelDataTypeUnsignedInt16 = 11,
- ImageChannelDataTypeUnsignedInt32 = 12,
- ImageChannelDataTypeHalfFloat = 13,
- ImageChannelDataTypeFloat = 14,
- ImageChannelDataTypeUnormInt24 = 15,
-};
-
-enum ImageOperandsShift {
- ImageOperandsBiasShift = 0,
- ImageOperandsLodShift = 1,
- ImageOperandsGradShift = 2,
- ImageOperandsConstOffsetShift = 3,
- ImageOperandsOffsetShift = 4,
- ImageOperandsConstOffsetsShift = 5,
- ImageOperandsSampleShift = 6,
- ImageOperandsMinLodShift = 7,
-};
-
-enum ImageOperandsMask {
- ImageOperandsMaskNone = 0,
- ImageOperandsBiasMask = 0x00000001,
- ImageOperandsLodMask = 0x00000002,
- ImageOperandsGradMask = 0x00000004,
- ImageOperandsConstOffsetMask = 0x00000008,
- ImageOperandsOffsetMask = 0x00000010,
- ImageOperandsConstOffsetsMask = 0x00000020,
- ImageOperandsSampleMask = 0x00000040,
- ImageOperandsMinLodMask = 0x00000080,
-};
-
-enum FPFastMathModeShift {
- FPFastMathModeNotNaNShift = 0,
- FPFastMathModeNotInfShift = 1,
- FPFastMathModeNSZShift = 2,
- FPFastMathModeAllowRecipShift = 3,
- FPFastMathModeFastShift = 4,
-};
-
-enum FPFastMathModeMask {
- FPFastMathModeMaskNone = 0,
- FPFastMathModeNotNaNMask = 0x00000001,
- FPFastMathModeNotInfMask = 0x00000002,
- FPFastMathModeNSZMask = 0x00000004,
- FPFastMathModeAllowRecipMask = 0x00000008,
- FPFastMathModeFastMask = 0x00000010,
-};
-
-enum FPRoundingMode {
- FPRoundingModeRTE = 0,
- FPRoundingModeRTZ = 1,
- FPRoundingModeRTP = 2,
- FPRoundingModeRTN = 3,
-};
-
-enum LinkageType {
- LinkageTypeExport = 0,
- LinkageTypeImport = 1,
-};
-
-enum AccessQualifier {
- AccessQualifierReadOnly = 0,
- AccessQualifierWriteOnly = 1,
- AccessQualifierReadWrite = 2,
-};
-
-enum FunctionParameterAttribute {
- FunctionParameterAttributeZext = 0,
- FunctionParameterAttributeSext = 1,
- FunctionParameterAttributeByVal = 2,
- FunctionParameterAttributeSret = 3,
- FunctionParameterAttributeNoAlias = 4,
- FunctionParameterAttributeNoCapture = 5,
- FunctionParameterAttributeNoWrite = 6,
- FunctionParameterAttributeNoReadWrite = 7,
-};
-
-enum Decoration {
- DecorationRelaxedPrecision = 0,
- DecorationSpecId = 1,
- DecorationBlock = 2,
- DecorationBufferBlock = 3,
- DecorationRowMajor = 4,
- DecorationColMajor = 5,
- DecorationArrayStride = 6,
- DecorationMatrixStride = 7,
- DecorationGLSLShared = 8,
- DecorationGLSLPacked = 9,
- DecorationCPacked = 10,
- DecorationBuiltIn = 11,
- DecorationSmooth = 12,
- DecorationNoPerspective = 13,
- DecorationFlat = 14,
- DecorationPatch = 15,
- DecorationCentroid = 16,
- DecorationSample = 17,
- DecorationInvariant = 18,
- DecorationRestrict = 19,
- DecorationAliased = 20,
- DecorationVolatile = 21,
- DecorationConstant = 22,
- DecorationCoherent = 23,
- DecorationNonWritable = 24,
- DecorationNonReadable = 25,
- DecorationUniform = 26,
- DecorationSaturatedConversion = 28,
- DecorationStream = 29,
- DecorationLocation = 30,
- DecorationComponent = 31,
- DecorationIndex = 32,
- DecorationBinding = 33,
- DecorationDescriptorSet = 34,
- DecorationOffset = 35,
- DecorationXfbBuffer = 36,
- DecorationXfbStride = 37,
- DecorationFuncParamAttr = 38,
- DecorationFPRoundingMode = 39,
- DecorationFPFastMathMode = 40,
- DecorationLinkageAttributes = 41,
- DecorationNoContraction = 42,
- DecorationInputTargetIndex = 43,
- DecorationAlignment = 44,
-};
-
-enum BuiltIn {
- BuiltInPosition = 0,
- BuiltInPointSize = 1,
- BuiltInClipDistance = 3,
- BuiltInCullDistance = 4,
- BuiltInVertexId = 5,
- BuiltInInstanceId = 6,
- BuiltInPrimitiveId = 7,
- BuiltInInvocationId = 8,
- BuiltInLayer = 9,
- BuiltInViewportIndex = 10,
- BuiltInTessLevelOuter = 11,
- BuiltInTessLevelInner = 12,
- BuiltInTessCoord = 13,
- BuiltInPatchVertices = 14,
- BuiltInFragCoord = 15,
- BuiltInPointCoord = 16,
- BuiltInFrontFacing = 17,
- BuiltInSampleId = 18,
- BuiltInSamplePosition = 19,
- BuiltInSampleMask = 20,
- BuiltInFragColor = 21,
- BuiltInFragDepth = 22,
- BuiltInHelperInvocation = 23,
- BuiltInNumWorkgroups = 24,
- BuiltInWorkgroupSize = 25,
- BuiltInWorkgroupId = 26,
- BuiltInLocalInvocationId = 27,
- BuiltInGlobalInvocationId = 28,
- BuiltInLocalInvocationIndex = 29,
- BuiltInWorkDim = 30,
- BuiltInGlobalSize = 31,
- BuiltInEnqueuedWorkgroupSize = 32,
- BuiltInGlobalOffset = 33,
- BuiltInGlobalLinearId = 34,
- BuiltInWorkgroupLinearId = 35,
- BuiltInSubgroupSize = 36,
- BuiltInSubgroupMaxSize = 37,
- BuiltInNumSubgroups = 38,
- BuiltInNumEnqueuedSubgroups = 39,
- BuiltInSubgroupId = 40,
- BuiltInSubgroupLocalInvocationId = 41,
- BuiltInVertexIndex = 42,
- BuiltInInstanceIndex = 43,
-};
-
-enum SelectionControlShift {
- SelectionControlFlattenShift = 0,
- SelectionControlDontFlattenShift = 1,
-};
-
-enum SelectionControlMask {
- SelectionControlMaskNone = 0,
- SelectionControlFlattenMask = 0x00000001,
- SelectionControlDontFlattenMask = 0x00000002,
-};
-
-enum LoopControlShift {
- LoopControlUnrollShift = 0,
- LoopControlDontUnrollShift = 1,
-};
-
-enum LoopControlMask {
- LoopControlMaskNone = 0,
- LoopControlUnrollMask = 0x00000001,
- LoopControlDontUnrollMask = 0x00000002,
-};
-
-enum FunctionControlShift {
- FunctionControlInlineShift = 0,
- FunctionControlDontInlineShift = 1,
- FunctionControlPureShift = 2,
- FunctionControlConstShift = 3,
-};
-
-enum FunctionControlMask {
- FunctionControlMaskNone = 0,
- FunctionControlInlineMask = 0x00000001,
- FunctionControlDontInlineMask = 0x00000002,
- FunctionControlPureMask = 0x00000004,
- FunctionControlConstMask = 0x00000008,
-};
-
-enum MemorySemanticsShift {
- MemorySemanticsAcquireShift = 0,
- MemorySemanticsReleaseShift = 1,
- MemorySemanticsSequentiallyConsistentShift = 2,
- MemorySemanticsUniformMemoryShift = 3,
- MemorySemanticsSubgroupMemoryShift = 4,
- MemorySemanticsWorkgroupLocalMemoryShift = 5,
- MemorySemanticsWorkgroupGlobalMemoryShift = 6,
- MemorySemanticsAtomicCounterMemoryShift = 7,
- MemorySemanticsImageMemoryShift = 8,
-};
-
-enum MemorySemanticsMask {
- MemorySemanticsMaskNone = 0,
- MemorySemanticsAcquireMask = 0x00000001,
- MemorySemanticsReleaseMask = 0x00000002,
- MemorySemanticsSequentiallyConsistentMask = 0x00000004,
- MemorySemanticsUniformMemoryMask = 0x00000008,
- MemorySemanticsSubgroupMemoryMask = 0x00000010,
- MemorySemanticsWorkgroupLocalMemoryMask = 0x00000020,
- MemorySemanticsWorkgroupGlobalMemoryMask = 0x00000040,
- MemorySemanticsAtomicCounterMemoryMask = 0x00000080,
- MemorySemanticsImageMemoryMask = 0x00000100,
-};
-
-enum MemoryAccessShift {
- MemoryAccessVolatileShift = 0,
- MemoryAccessAlignedShift = 1,
- MemoryAccessNontemporalShift = 2,
-};
-
-enum MemoryAccessMask {
- MemoryAccessMaskNone = 0,
- MemoryAccessVolatileMask = 0x00000001,
- MemoryAccessAlignedMask = 0x00000002,
- MemoryAccessNontemporalMask = 0x00000004,
-};
-
-enum Scope {
- ScopeCrossDevice = 0,
- ScopeDevice = 1,
- ScopeWorkgroup = 2,
- ScopeSubgroup = 3,
- ScopeInvocation = 4,
-};
-
-enum GroupOperation {
- GroupOperationReduce = 0,
- GroupOperationInclusiveScan = 1,
- GroupOperationExclusiveScan = 2,
-};
-
-enum KernelEnqueueFlags {
- KernelEnqueueFlagsNoWait = 0,
- KernelEnqueueFlagsWaitKernel = 1,
- KernelEnqueueFlagsWaitWorkGroup = 2,
-};
-
-enum KernelProfilingInfoShift {
- KernelProfilingInfoCmdExecTimeShift = 0,
-};
-
-enum KernelProfilingInfoMask {
- KernelProfilingInfoMaskNone = 0,
- KernelProfilingInfoCmdExecTimeMask = 0x00000001,
-};
-
-enum Capability {
- CapabilityMatrix = 0,
- CapabilityShader = 1,
- CapabilityGeometry = 2,
- CapabilityTessellation = 3,
- CapabilityAddresses = 4,
- CapabilityLinkage = 5,
- CapabilityKernel = 6,
- CapabilityVector16 = 7,
- CapabilityFloat16Buffer = 8,
- CapabilityFloat16 = 9,
- CapabilityFloat64 = 10,
- CapabilityInt64 = 11,
- CapabilityInt64Atomics = 12,
- CapabilityImageBasic = 13,
- CapabilityImageReadWrite = 14,
- CapabilityImageMipmap = 15,
- CapabilityImageSRGBWrite = 16,
- CapabilityPipes = 17,
- CapabilityGroups = 18,
- CapabilityDeviceEnqueue = 19,
- CapabilityLiteralSampler = 20,
- CapabilityAtomicStorage = 21,
- CapabilityInt16 = 22,
- CapabilityTessellationPointSize = 23,
- CapabilityGeometryPointSize = 24,
- CapabilityImageGatherExtended = 25,
- CapabilityStorageImageExtendedFormats = 26,
- CapabilityStorageImageMultisample = 27,
- CapabilityUniformBufferArrayDynamicIndexing = 28,
- CapabilitySampledImageArrayDynamicIndexing = 29,
- CapabilityStorageBufferArrayDynamicIndexing = 30,
- CapabilityStorageImageArrayDynamicIndexing = 31,
- CapabilityClipDistance = 32,
- CapabilityCullDistance = 33,
- CapabilityImageCubeArray = 34,
- CapabilitySampleRateShading = 35,
- CapabilityImageRect = 36,
- CapabilitySampledRect = 37,
- CapabilityGenericPointer = 38,
- CapabilityInt8 = 39,
- CapabilityInputTarget = 40,
- CapabilitySparseResidency = 41,
- CapabilityMinLod = 42,
- CapabilitySampled1D = 43,
- CapabilityImage1D = 44,
- CapabilitySampledCubeArray = 45,
- CapabilitySampledBuffer = 46,
- CapabilityImageBuffer = 47,
- CapabilityImageMSArray = 48,
- CapabilityAdvancedFormats = 49,
- CapabilityImageQuery = 50,
- CapabilityDerivativeControl = 51,
- CapabilityInterpolationFunction = 52,
- CapabilityTransformFeedback = 53,
-};
-
-enum Op {
- OpNop = 0,
- OpUndef = 1,
- OpSourceContinued = 2,
- OpSource = 3,
- OpSourceExtension = 4,
- OpName = 5,
- OpMemberName = 6,
- OpString = 7,
- OpLine = 8,
- OpExtension = 10,
- OpExtInstImport = 11,
- OpExtInst = 12,
- OpMemoryModel = 14,
- OpEntryPoint = 15,
- OpExecutionMode = 16,
- OpCapability = 17,
- OpTypeVoid = 19,
- OpTypeBool = 20,
- OpTypeInt = 21,
- OpTypeFloat = 22,
- OpTypeVector = 23,
- OpTypeMatrix = 24,
- OpTypeImage = 25,
- OpTypeSampler = 26,
- OpTypeSampledImage = 27,
- OpTypeArray = 28,
- OpTypeRuntimeArray = 29,
- OpTypeStruct = 30,
- OpTypeOpaque = 31,
- OpTypePointer = 32,
- OpTypeFunction = 33,
- OpTypeEvent = 34,
- OpTypeDeviceEvent = 35,
- OpTypeReserveId = 36,
- OpTypeQueue = 37,
- OpTypePipe = 38,
- OpTypeForwardPointer = 39,
- OpConstantTrue = 41,
- OpConstantFalse = 42,
- OpConstant = 43,
- OpConstantComposite = 44,
- OpConstantSampler = 45,
- OpConstantNull = 46,
- OpSpecConstantTrue = 48,
- OpSpecConstantFalse = 49,
- OpSpecConstant = 50,
- OpSpecConstantComposite = 51,
- OpSpecConstantOp = 52,
- OpFunction = 54,
- OpFunctionParameter = 55,
- OpFunctionEnd = 56,
- OpFunctionCall = 57,
- OpVariable = 59,
- OpImageTexelPointer = 60,
- OpLoad = 61,
- OpStore = 62,
- OpCopyMemory = 63,
- OpCopyMemorySized = 64,
- OpAccessChain = 65,
- OpInBoundsAccessChain = 66,
- OpPtrAccessChain = 67,
- OpArrayLength = 68,
- OpGenericPtrMemSemantics = 69,
- OpInBoundsPtrAccessChain = 70,
- OpDecorate = 71,
- OpMemberDecorate = 72,
- OpDecorationGroup = 73,
- OpGroupDecorate = 74,
- OpGroupMemberDecorate = 75,
- OpVectorExtractDynamic = 77,
- OpVectorInsertDynamic = 78,
- OpVectorShuffle = 79,
- OpCompositeConstruct = 80,
- OpCompositeExtract = 81,
- OpCompositeInsert = 82,
- OpCopyObject = 83,
- OpTranspose = 84,
- OpSampledImage = 86,
- OpImageSampleImplicitLod = 87,
- OpImageSampleExplicitLod = 88,
- OpImageSampleDrefImplicitLod = 89,
- OpImageSampleDrefExplicitLod = 90,
- OpImageSampleProjImplicitLod = 91,
- OpImageSampleProjExplicitLod = 92,
- OpImageSampleProjDrefImplicitLod = 93,
- OpImageSampleProjDrefExplicitLod = 94,
- OpImageFetch = 95,
- OpImageGather = 96,
- OpImageDrefGather = 97,
- OpImageRead = 98,
- OpImageWrite = 99,
- OpImageQueryFormat = 101,
- OpImageQueryOrder = 102,
- OpImageQuerySizeLod = 103,
- OpImageQuerySize = 104,
- OpImageQueryLod = 105,
- OpImageQueryLevels = 106,
- OpImageQuerySamples = 107,
- OpConvertFToU = 109,
- OpConvertFToS = 110,
- OpConvertSToF = 111,
- OpConvertUToF = 112,
- OpUConvert = 113,
- OpSConvert = 114,
- OpFConvert = 115,
- OpQuantizeToF16 = 116,
- OpConvertPtrToU = 117,
- OpSatConvertSToU = 118,
- OpSatConvertUToS = 119,
- OpConvertUToPtr = 120,
- OpPtrCastToGeneric = 121,
- OpGenericCastToPtr = 122,
- OpGenericCastToPtrExplicit = 123,
- OpBitcast = 124,
- OpSNegate = 126,
- OpFNegate = 127,
- OpIAdd = 128,
- OpFAdd = 129,
- OpISub = 130,
- OpFSub = 131,
- OpIMul = 132,
- OpFMul = 133,
- OpUDiv = 134,
- OpSDiv = 135,
- OpFDiv = 136,
- OpUMod = 137,
- OpSRem = 138,
- OpSMod = 139,
- OpFRem = 140,
- OpFMod = 141,
- OpVectorTimesScalar = 142,
- OpMatrixTimesScalar = 143,
- OpVectorTimesMatrix = 144,
- OpMatrixTimesVector = 145,
- OpMatrixTimesMatrix = 146,
- OpOuterProduct = 147,
- OpDot = 148,
- OpIAddCarry = 149,
- OpISubBorrow = 150,
- OpUMulExtended = 151,
- OpSMulExtended = 152,
- OpAny = 154,
- OpAll = 155,
- OpIsNan = 156,
- OpIsInf = 157,
- OpIsFinite = 158,
- OpIsNormal = 159,
- OpSignBitSet = 160,
- OpLessOrGreater = 161,
- OpOrdered = 162,
- OpUnordered = 163,
- OpLogicalEqual = 164,
- OpLogicalNotEqual = 165,
- OpLogicalOr = 166,
- OpLogicalAnd = 167,
- OpLogicalNot = 168,
- OpSelect = 169,
- OpIEqual = 170,
- OpINotEqual = 171,
- OpUGreaterThan = 172,
- OpSGreaterThan = 173,
- OpUGreaterThanEqual = 174,
- OpSGreaterThanEqual = 175,
- OpULessThan = 176,
- OpSLessThan = 177,
- OpULessThanEqual = 178,
- OpSLessThanEqual = 179,
- OpFOrdEqual = 180,
- OpFUnordEqual = 181,
- OpFOrdNotEqual = 182,
- OpFUnordNotEqual = 183,
- OpFOrdLessThan = 184,
- OpFUnordLessThan = 185,
- OpFOrdGreaterThan = 186,
- OpFUnordGreaterThan = 187,
- OpFOrdLessThanEqual = 188,
- OpFUnordLessThanEqual = 189,
- OpFOrdGreaterThanEqual = 190,
- OpFUnordGreaterThanEqual = 191,
- OpShiftRightLogical = 194,
- OpShiftRightArithmetic = 195,
- OpShiftLeftLogical = 196,
- OpBitwiseOr = 197,
- OpBitwiseXor = 198,
- OpBitwiseAnd = 199,
- OpNot = 200,
- OpBitFieldInsert = 201,
- OpBitFieldSExtract = 202,
- OpBitFieldUExtract = 203,
- OpBitReverse = 204,
- OpBitCount = 205,
- OpDPdx = 207,
- OpDPdy = 208,
- OpFwidth = 209,
- OpDPdxFine = 210,
- OpDPdyFine = 211,
- OpFwidthFine = 212,
- OpDPdxCoarse = 213,
- OpDPdyCoarse = 214,
- OpFwidthCoarse = 215,
- OpEmitVertex = 218,
- OpEndPrimitive = 219,
- OpEmitStreamVertex = 220,
- OpEndStreamPrimitive = 221,
- OpControlBarrier = 224,
- OpMemoryBarrier = 225,
- OpAtomicLoad = 227,
- OpAtomicStore = 228,
- OpAtomicExchange = 229,
- OpAtomicCompareExchange = 230,
- OpAtomicCompareExchangeWeak = 231,
- OpAtomicIIncrement = 232,
- OpAtomicIDecrement = 233,
- OpAtomicIAdd = 234,
- OpAtomicISub = 235,
- OpAtomicSMin = 236,
- OpAtomicUMin = 237,
- OpAtomicSMax = 238,
- OpAtomicUMax = 239,
- OpAtomicAnd = 240,
- OpAtomicOr = 241,
- OpAtomicXor = 242,
- OpPhi = 245,
- OpLoopMerge = 246,
- OpSelectionMerge = 247,
- OpLabel = 248,
- OpBranch = 249,
- OpBranchConditional = 250,
- OpSwitch = 251,
- OpKill = 252,
- OpReturn = 253,
- OpReturnValue = 254,
- OpUnreachable = 255,
- OpLifetimeStart = 256,
- OpLifetimeStop = 257,
- OpAsyncGroupCopy = 259,
- OpWaitGroupEvents = 260,
- OpGroupAll = 261,
- OpGroupAny = 262,
- OpGroupBroadcast = 263,
- OpGroupIAdd = 264,
- OpGroupFAdd = 265,
- OpGroupFMin = 266,
- OpGroupUMin = 267,
- OpGroupSMin = 268,
- OpGroupFMax = 269,
- OpGroupUMax = 270,
- OpGroupSMax = 271,
- OpReadPipe = 274,
- OpWritePipe = 275,
- OpReservedReadPipe = 276,
- OpReservedWritePipe = 277,
- OpReserveReadPipePackets = 278,
- OpReserveWritePipePackets = 279,
- OpCommitReadPipe = 280,
- OpCommitWritePipe = 281,
- OpIsValidReserveId = 282,
- OpGetNumPipePackets = 283,
- OpGetMaxPipePackets = 284,
- OpGroupReserveReadPipePackets = 285,
- OpGroupReserveWritePipePackets = 286,
- OpGroupCommitReadPipe = 287,
- OpGroupCommitWritePipe = 288,
- OpEnqueueMarker = 291,
- OpEnqueueKernel = 292,
- OpGetKernelNDrangeSubGroupCount = 293,
- OpGetKernelNDrangeMaxSubGroupSize = 294,
- OpGetKernelWorkGroupSize = 295,
- OpGetKernelPreferredWorkGroupSizeMultiple = 296,
- OpRetainEvent = 297,
- OpReleaseEvent = 298,
- OpCreateUserEvent = 299,
- OpIsValidEvent = 300,
- OpSetUserEventStatus = 301,
- OpCaptureEventProfilingInfo = 302,
- OpGetDefaultQueue = 303,
- OpBuildNDRange = 304,
- OpImageSparseSampleImplicitLod = 305,
- OpImageSparseSampleExplicitLod = 306,
- OpImageSparseSampleDrefImplicitLod = 307,
- OpImageSparseSampleDrefExplicitLod = 308,
- OpImageSparseSampleProjImplicitLod = 309,
- OpImageSparseSampleProjExplicitLod = 310,
- OpImageSparseSampleProjDrefImplicitLod = 311,
- OpImageSparseSampleProjDrefExplicitLod = 312,
- OpImageSparseFetch = 313,
- OpImageSparseGather = 314,
- OpImageSparseDrefGather = 315,
- OpImageSparseTexelsResident = 316,
- OpNoLine = 317,
- OpAtomicFlagTestAndSet = 318,
- OpAtomicFlagClear = 319,
-};
-
-// Overload operator| for mask bit combining
-
-inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
-inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
-inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
-inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
-inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
-inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
-inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
-inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
-
-} // end namespace spv
-
-#endif // #ifndef spirv_H
-
#ifndef LIBSPIRV_LIBSPIRV_LIBSPIRV_H_
#define LIBSPIRV_LIBSPIRV_LIBSPIRV_H_
-#include <headers/spirv.hpp>
+#include <headers/spirv.h>
#include <headers/spirv_operands.hpp>
#include <headers/GLSL.std.450.h>
#include <headers/OpenCL.std.h>
typedef struct spv_opcode_desc_t {
const char *name;
- const Op opcode;
+ const SpvOp opcode;
const spv_capability_mask_t
capabilities; // Bitfield of SPV_CAPABILITY_AS_MASK(spv::Capability)
// operandTypes[0..numTypes-1] describe logical operands for the instruction.
return spvOpcodeTableNameLookup(opcodeTable_, name, desc);
}
-spv_result_t AssemblyGrammar::lookupOpcode(Op opcode,
+spv_result_t AssemblyGrammar::lookupOpcode(SpvOp opcode,
spv_opcode_desc *desc) const {
return spvOpcodeTableValueLookup(opcodeTable_, opcode, desc);
}
// Fills in the desc parameter with the information about the opcode
// of the valid. Returns SPV_SUCCESS if the opcode was found, and
// SPV_ERROR_INVALID_LOOKUP if the opcode does not exist.
- spv_result_t lookupOpcode(Op opcode, spv_opcode_desc *desc) const;
+ spv_result_t lookupOpcode(SpvOp opcode, spv_opcode_desc *desc) const;
// Fills in the desc parameter with the information about the given
// operand. Returns SPV_SUCCESS if the operand was found, and
// NOTE: Use specified operand entry operand type for this word
uint16_t index = operandIndex - opcodeEntry->numTypes;
type = (*pOperandEntry)->operandTypes[index];
- } else if (OpSwitch == opcodeEntry->opcode) {
+ } else if (SpvOpSwitch == opcodeEntry->opcode) {
// NOTE: OpSwitch is a special case which expects a list of paired extra
// operands
assert(0 &&
///
/// @return result code
spv_result_t spvBinaryDecodeOperand(
- const Op opcode, const spv_operand_type_t type, const uint32_t *words,
+ const SpvOp opcode, const spv_operand_type_t type, const uint32_t *words,
uint16_t numWords, const spv_endianness_t endian, const uint32_t options,
const libspirv::AssemblyGrammar& grammar,
spv_operand_pattern_t *pExpectedOperands, spv_ext_inst_type_t *pExtInstType,
position->index++;
} break;
case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: {
- if (OpExtInst == opcode) {
+ if (SpvOpExtInst == opcode) {
spv_ext_inst_desc extInst;
if (grammar.lookupExtInst(*pExtInstType, words[0], &extInst)) {
DIAGNOSTIC << "Invalid extended instruction '" << words[0] << "'.";
uint64_t stringOperandCount = (strlen(string) / 4) + 1;
// NOTE: Special case for extended instruction import
- if (OpExtInstImport == opcode) {
+ if (SpvOpExtInstImport == opcode) {
*pExtInstType = spvExtInstImportTypeGet(string);
if (SPV_EXT_INST_TYPE_NONE == *pExtInstType) {
DIAGNOSTIC << "Invalid extended instruction import'" << string
spv_diagnostic* pDiagnostic) {
libspirv::IdType detected_type = libspirv::kUnknownType;
if (spvOpcodeIsType(pOpcodeEntry->opcode)) {
- if (spv::OpTypeInt == pOpcodeEntry->opcode) {
+ if (SpvOpTypeInt == pOpcodeEntry->opcode) {
detected_type.type_class = libspirv::IdTypeClass::kScalarIntegerType;
detected_type.bitwidth = pInst->words[2];
detected_type.isSigned = (pInst->words[3] != 0);
- } else if (spv::OpTypeFloat == pOpcodeEntry->opcode) {
+ } else if (SpvOpTypeFloat == pOpcodeEntry->opcode) {
detected_type.type_class = libspirv::IdTypeClass::kScalarIntegerType;
detected_type.bitwidth = pInst->words[2];
detected_type.isSigned = true;
spv_position_t instructionStart = *position;
uint16_t wordCount;
- Op opcode;
+ SpvOp opcode;
spvOpcodeSplit(spvFixWord(pInst->words[0], endian), &wordCount, &opcode);
spv_opcode_desc opcodeEntry;
while (position.index < binary.wordCount) {
uint64_t index = position.index;
uint16_t wordCount;
- Op opcode;
+ SpvOp opcode;
spvOpcodeSplit(spvFixWord(words[position.index], endian), &wordCount,
&opcode);
#include <cstdint>
#include <vector>
-#include <headers/spirv.hpp>
+#include <headers/spirv.h>
// Describes an instruction.
struct spv_instruction_t {
// Normally, both opcode and extInstType contain valid data.
// However, when the assembler parses !<number> as the first word in
// an instruction and opcode and extInstType are invalid.
- Op opcode;
+ SpvOp opcode;
spv_ext_inst_type_t extInstType;
// The Id of the result type, if this instruction has one. Zero otherwise.
spv_opcode_desc_t opcodeTableEntries[] = {
#define EmptyList {}
#define List(...) {__VA_ARGS__}
-#define Capability(X) SPV_CAPABILITY_AS_MASK(Capability##X)
+#define Capability(X) SPV_CAPABILITY_AS_MASK(SpvCapability##X)
#define Capability2(X,Y) Capability(X)|Capability(Y)
-#define CapabilityNone 0 // Needed so Capability(None) still expands to valid syntax.
+#define SpvCapabilityNone 0 // Needed so Capability(None) still expands to valid syntax.
#define Instruction(Name,HasResult,HasType,NumLogicalOperands,NumCapabilities,CapabilityRequired,IsVariable,LogicalArgsList) \
{ #Name, \
- Op##Name, \
+ SpvOp##Name, \
(NumCapabilities) ? (CapabilityRequired) : 0, \
0, {}, /* Filled in later. Operand list, including result id and type id, if needed */ \
HasResult, \
// Converts the given operand class enum (from the SPIR-V document generation
// logic) to the operand type required by the parser.
// This only applies to logical operands.
-spv_operand_type_t convertOperandClassToType(spv::Op opcode,
- spv::OperandClass operandClass) {
+spv_operand_type_t convertOperandClassToType(SpvOp opcode,
+ OperandClass operandClass) {
// The spec document generator uses OptionalOperandLiteral for several kinds
// of repeating values. Our parser needs more specific information about
// what is being repeated.
if (operandClass == OperandOptionalLiteral) {
switch (opcode) {
- case spv::OpLoad:
- case spv::OpStore:
- case spv::OpCopyMemory:
- case spv::OpCopyMemorySized:
+ case SpvOpLoad:
+ case SpvOpStore:
+ case SpvOpCopyMemory:
+ case SpvOpCopyMemorySized:
// Expect an optional mask. When the Aligned bit is set in the mask,
// we will later add the expectation of a literal number operand.
return SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS;
- case spv::OpExecutionMode:
+ case SpvOpExecutionMode:
return SPV_OPERAND_TYPE_VARIABLE_EXECUTION_MODE;
default:
break;
}
} else if (operandClass == OperandVariableLiterals) {
- if (opcode == spv::OpConstant || opcode == spv::OpSpecConstant)
+ if (opcode == SpvOpConstant || opcode == SpvOpSpecConstant)
return SPV_OPERAND_TYPE_MULTIWORD_LITERAL_NUMBER;
}
// This is only used for sequences of literal numbers.
case OperandVariableLiterals: return SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER;
case OperandLiteralNumber:
- if (opcode == spv::OpExtInst) {
+ if (opcode == SpvOpExtInst) {
// We use a special operand type for the extension instruction number.
// For now, we assume there is only one LiteraNumber argument to OpExtInst,
// and it is the extension instruction argument.
}
}
-uint32_t spvOpcodeMake(uint16_t wordCount, Op opcode) {
+uint32_t spvOpcodeMake(uint16_t wordCount, SpvOp opcode) {
return ((uint32_t)opcode) | (((uint32_t)wordCount) << 16);
}
-void spvOpcodeSplit(const uint32_t word, uint16_t *pWordCount, Op *pOpcode) {
+void spvOpcodeSplit(const uint32_t word, uint16_t *pWordCount, SpvOp *pOpcode) {
if (pWordCount) {
*pWordCount = (uint16_t)((0xffff0000 & word) >> 16);
}
if (pOpcode) {
- *pOpcode = (Op)(0x0000ffff & word);
+ *pOpcode = (SpvOp)(0x0000ffff & word);
}
}
}
spv_result_t spvOpcodeTableValueLookup(const spv_opcode_table table,
- const Op opcode,
+ const SpvOp opcode,
spv_opcode_desc *pEntry) {
if (!table) return SPV_ERROR_INVALID_TABLE;
if (!pEntry) return SPV_ERROR_INVALID_POINTER;
return entry->capabilities != 0;
}
-void spvInstructionCopy(const uint32_t *words, const Op opcode,
+void spvInstructionCopy(const uint32_t *words, const SpvOp opcode,
const uint16_t wordCount, const spv_endianness_t endian,
spv_instruction_t *pInst) {
pInst->opcode = opcode;
pInst->words[wordIndex] = spvFixWord(words[wordIndex], endian);
if (!wordIndex) {
uint16_t thisWordCount;
- Op thisOpcode;
+ SpvOp thisOpcode;
spvOpcodeSplit(pInst->words[wordIndex], &thisWordCount, &thisOpcode);
assert(opcode == thisOpcode && wordCount == thisWordCount &&
"Endianness failed!");
}
}
-const char *spvOpcodeString(const Op opcode) {
+const char *spvOpcodeString(const SpvOp opcode) {
#define CASE(OPCODE) \
- case OPCODE: \
+ case Spv##OPCODE: \
return #OPCODE;
switch (opcode) {
CASE(OpNop)
return "unknown";
}
-int32_t spvOpcodeIsType(const Op opcode) {
+int32_t spvOpcodeIsType(const SpvOp opcode) {
switch (opcode) {
- case OpTypeVoid:
- case OpTypeBool:
- case OpTypeInt:
- case OpTypeFloat:
- case OpTypeVector:
- case OpTypeMatrix:
- case OpTypeSampler:
- case OpTypeSampledImage:
- case OpTypeArray:
- case OpTypeRuntimeArray:
- case OpTypeStruct:
- case OpTypeOpaque:
- case OpTypePointer:
- case OpTypeFunction:
- case OpTypeEvent:
- case OpTypeDeviceEvent:
- case OpTypeReserveId:
- case OpTypeQueue:
- case OpTypePipe:
+ case SpvOpTypeVoid:
+ case SpvOpTypeBool:
+ case SpvOpTypeInt:
+ case SpvOpTypeFloat:
+ case SpvOpTypeVector:
+ case SpvOpTypeMatrix:
+ case SpvOpTypeSampler:
+ case SpvOpTypeSampledImage:
+ case SpvOpTypeArray:
+ case SpvOpTypeRuntimeArray:
+ case SpvOpTypeStruct:
+ case SpvOpTypeOpaque:
+ case SpvOpTypePointer:
+ case SpvOpTypeFunction:
+ case SpvOpTypeEvent:
+ case SpvOpTypeDeviceEvent:
+ case SpvOpTypeReserveId:
+ case SpvOpTypeQueue:
+ case SpvOpTypePipe:
return true;
default:
return false;
}
}
-int32_t spvOpcodeIsScalarType(const Op opcode) {
+int32_t spvOpcodeIsScalarType(const SpvOp opcode) {
switch (opcode) {
- case OpTypeInt:
- case OpTypeFloat:
+ case SpvOpTypeInt:
+ case SpvOpTypeFloat:
return true;
default:
return false;
}
}
-int32_t spvOpcodeIsConstant(const Op opcode) {
+int32_t spvOpcodeIsConstant(const SpvOp opcode) {
switch (opcode) {
- case OpConstantTrue:
- case OpConstantFalse:
- case OpConstant:
- case OpConstantComposite:
- case OpConstantSampler:
- // case OpConstantNull:
- case OpConstantNull:
- case OpSpecConstantTrue:
- case OpSpecConstantFalse:
- case OpSpecConstant:
- case OpSpecConstantComposite:
- // case OpSpecConstantOp:
+ case SpvOpConstantTrue:
+ case SpvOpConstantFalse:
+ case SpvOpConstant:
+ case SpvOpConstantComposite:
+ case SpvOpConstantSampler:
+ // case SpvOpConstantNull:
+ case SpvOpConstantNull:
+ case SpvOpSpecConstantTrue:
+ case SpvOpSpecConstantFalse:
+ case SpvOpSpecConstant:
+ case SpvOpSpecConstantComposite:
+ // case SpvOpSpecConstantOp:
return true;
default:
return false;
}
}
-int32_t spvOpcodeIsComposite(const Op opcode) {
+int32_t spvOpcodeIsComposite(const SpvOp opcode) {
switch (opcode) {
- case OpTypeVector:
- case OpTypeMatrix:
- case OpTypeArray:
- case OpTypeStruct:
+ case SpvOpTypeVector:
+ case SpvOpTypeMatrix:
+ case SpvOpTypeArray:
+ case SpvOpTypeStruct:
return true;
default:
return false;
return true;
}
-int32_t spvOpcodeIsPointer(const Op opcode) {
+int32_t spvOpcodeIsPointer(const SpvOp opcode) {
switch (opcode) {
- case OpVariable:
- case OpAccessChain:
- case OpInBoundsAccessChain:
- case OpFunctionParameter:
+ case SpvOpVariable:
+ case SpvOpAccessChain:
+ case SpvOpInBoundsAccessChain:
+ case SpvOpFunctionParameter:
return true;
default:
return false;
}
}
-int32_t spvOpcodeIsObject(const Op opcode) {
+int32_t spvOpcodeIsObject(const SpvOp opcode) {
switch (opcode) {
- case OpConstantTrue:
- case OpConstantFalse:
- case OpConstant:
- case OpConstantComposite:
- // TODO: case OpConstantSampler:
- case OpConstantNull:
- case OpSpecConstantTrue:
- case OpSpecConstantFalse:
- case OpSpecConstant:
- case OpSpecConstantComposite:
- // TODO: case OpSpecConstantOp:
- case OpVariable:
- case OpAccessChain:
- case OpInBoundsAccessChain:
- case OpConvertFToU:
- case OpConvertFToS:
- case OpConvertSToF:
- case OpConvertUToF:
- case OpUConvert:
- case OpSConvert:
- case OpFConvert:
- case OpConvertPtrToU:
- // TODO: case OpConvertUToPtr:
- case OpPtrCastToGeneric:
- // TODO: case OpGenericCastToPtr:
- case OpBitcast:
- // TODO: case OpGenericCastToPtrExplicit:
- case OpSatConvertSToU:
- case OpSatConvertUToS:
- case OpVectorExtractDynamic:
- case OpCompositeConstruct:
- case OpCompositeExtract:
- case OpCopyObject:
- case OpTranspose:
- case OpSNegate:
- case OpFNegate:
- case OpNot:
- case OpIAdd:
- case OpFAdd:
- case OpISub:
- case OpFSub:
- case OpIMul:
- case OpFMul:
- case OpUDiv:
- case OpSDiv:
- case OpFDiv:
- case OpUMod:
- case OpSRem:
- case OpSMod:
- case OpVectorTimesScalar:
- case OpMatrixTimesScalar:
- case OpVectorTimesMatrix:
- case OpMatrixTimesVector:
- case OpMatrixTimesMatrix:
- case OpOuterProduct:
- case OpDot:
- case OpShiftRightLogical:
- case OpShiftRightArithmetic:
- case OpShiftLeftLogical:
- case OpBitwiseOr:
- case OpBitwiseXor:
- case OpBitwiseAnd:
- case OpAny:
- case OpAll:
- case OpIsNan:
- case OpIsInf:
- case OpIsFinite:
- case OpIsNormal:
- case OpSignBitSet:
- case OpLessOrGreater:
- case OpOrdered:
- case OpUnordered:
- case OpLogicalOr:
- case OpLogicalAnd:
- case OpSelect:
- case OpIEqual:
- case OpFOrdEqual:
- case OpFUnordEqual:
- case OpINotEqual:
- case OpFOrdNotEqual:
- case OpFUnordNotEqual:
- case OpULessThan:
- case OpSLessThan:
- case OpFOrdLessThan:
- case OpFUnordLessThan:
- case OpUGreaterThan:
- case OpSGreaterThan:
- case OpFOrdGreaterThan:
- case OpFUnordGreaterThan:
- case OpULessThanEqual:
- case OpSLessThanEqual:
- case OpFOrdLessThanEqual:
- case OpFUnordLessThanEqual:
- case OpUGreaterThanEqual:
- case OpSGreaterThanEqual:
- case OpFOrdGreaterThanEqual:
- case OpFUnordGreaterThanEqual:
- case OpDPdx:
- case OpDPdy:
- case OpFwidth:
- case OpDPdxFine:
- case OpDPdyFine:
- case OpFwidthFine:
- case OpDPdxCoarse:
- case OpDPdyCoarse:
- case OpFwidthCoarse:
- case OpReturnValue:
+ case SpvOpConstantTrue:
+ case SpvOpConstantFalse:
+ case SpvOpConstant:
+ case SpvOpConstantComposite:
+ // TODO: case SpvOpConstantSampler:
+ case SpvOpConstantNull:
+ case SpvOpSpecConstantTrue:
+ case SpvOpSpecConstantFalse:
+ case SpvOpSpecConstant:
+ case SpvOpSpecConstantComposite:
+ // TODO: case SpvOpSpecConstantOp:
+ case SpvOpVariable:
+ case SpvOpAccessChain:
+ case SpvOpInBoundsAccessChain:
+ case SpvOpConvertFToU:
+ case SpvOpConvertFToS:
+ case SpvOpConvertSToF:
+ case SpvOpConvertUToF:
+ case SpvOpUConvert:
+ case SpvOpSConvert:
+ case SpvOpFConvert:
+ case SpvOpConvertPtrToU:
+ // TODO: case SpvOpConvertUToPtr:
+ case SpvOpPtrCastToGeneric:
+ // TODO: case SpvOpGenericCastToPtr:
+ case SpvOpBitcast:
+ // TODO: case SpvOpGenericCastToPtrExplicit:
+ case SpvOpSatConvertSToU:
+ case SpvOpSatConvertUToS:
+ case SpvOpVectorExtractDynamic:
+ case SpvOpCompositeConstruct:
+ case SpvOpCompositeExtract:
+ case SpvOpCopyObject:
+ case SpvOpTranspose:
+ case SpvOpSNegate:
+ case SpvOpFNegate:
+ case SpvOpNot:
+ case SpvOpIAdd:
+ case SpvOpFAdd:
+ case SpvOpISub:
+ case SpvOpFSub:
+ case SpvOpIMul:
+ case SpvOpFMul:
+ case SpvOpUDiv:
+ case SpvOpSDiv:
+ case SpvOpFDiv:
+ case SpvOpUMod:
+ case SpvOpSRem:
+ case SpvOpSMod:
+ case SpvOpVectorTimesScalar:
+ case SpvOpMatrixTimesScalar:
+ case SpvOpVectorTimesMatrix:
+ case SpvOpMatrixTimesVector:
+ case SpvOpMatrixTimesMatrix:
+ case SpvOpOuterProduct:
+ case SpvOpDot:
+ case SpvOpShiftRightLogical:
+ case SpvOpShiftRightArithmetic:
+ case SpvOpShiftLeftLogical:
+ case SpvOpBitwiseOr:
+ case SpvOpBitwiseXor:
+ case SpvOpBitwiseAnd:
+ case SpvOpAny:
+ case SpvOpAll:
+ case SpvOpIsNan:
+ case SpvOpIsInf:
+ case SpvOpIsFinite:
+ case SpvOpIsNormal:
+ case SpvOpSignBitSet:
+ case SpvOpLessOrGreater:
+ case SpvOpOrdered:
+ case SpvOpUnordered:
+ case SpvOpLogicalOr:
+ case SpvOpLogicalAnd:
+ case SpvOpSelect:
+ case SpvOpIEqual:
+ case SpvOpFOrdEqual:
+ case SpvOpFUnordEqual:
+ case SpvOpINotEqual:
+ case SpvOpFOrdNotEqual:
+ case SpvOpFUnordNotEqual:
+ case SpvOpULessThan:
+ case SpvOpSLessThan:
+ case SpvOpFOrdLessThan:
+ case SpvOpFUnordLessThan:
+ case SpvOpUGreaterThan:
+ case SpvOpSGreaterThan:
+ case SpvOpFOrdGreaterThan:
+ case SpvOpFUnordGreaterThan:
+ case SpvOpULessThanEqual:
+ case SpvOpSLessThanEqual:
+ case SpvOpFOrdLessThanEqual:
+ case SpvOpFUnordLessThanEqual:
+ case SpvOpUGreaterThanEqual:
+ case SpvOpSGreaterThanEqual:
+ case SpvOpFOrdGreaterThanEqual:
+ case SpvOpFUnordGreaterThanEqual:
+ case SpvOpDPdx:
+ case SpvOpDPdy:
+ case SpvOpFwidth:
+ case SpvOpDPdxFine:
+ case SpvOpDPdyFine:
+ case SpvOpFwidthFine:
+ case SpvOpDPdxCoarse:
+ case SpvOpDPdyCoarse:
+ case SpvOpFwidthCoarse:
+ case SpvOpReturnValue:
return true;
default:
return false;
}
}
-int32_t spvOpcodeIsBasicTypeNullable(Op opcode) {
+int32_t spvOpcodeIsBasicTypeNullable(SpvOp opcode) {
switch (opcode) {
- case OpTypeBool:
- case OpTypeInt:
- case OpTypeFloat:
- case OpTypePointer:
- case OpTypeEvent:
- case OpTypeDeviceEvent:
- case OpTypeReserveId:
- case OpTypeQueue:
+ case SpvOpTypeBool:
+ case SpvOpTypeInt:
+ case SpvOpTypeFloat:
+ case SpvOpTypePointer:
+ case SpvOpTypeEvent:
+ case SpvOpTypeDeviceEvent:
+ case SpvOpTypeReserveId:
+ case SpvOpTypeQueue:
return true;
default:
return false;
int32_t spvInstructionIsInBasicBlock(const spv_instruction_t *pFirstInst,
const spv_instruction_t *pInst) {
while (pFirstInst != pInst) {
- if (OpFunction == pInst->opcode) break;
+ if (SpvOpFunction == pInst->opcode) break;
pInst--;
}
- if (OpFunction != pInst->opcode) return false;
+ if (SpvOpFunction != pInst->opcode) return false;
return true;
}
-int32_t spvOpcodeIsValue(Op opcode) {
+int32_t spvOpcodeIsValue(SpvOp opcode) {
if (spvOpcodeIsPointer(opcode)) return true;
if (spvOpcodeIsConstant(opcode)) return true;
switch (opcode) {
- case OpLoad:
+ case SpvOpLoad:
// TODO: Other Opcode's resulting in a value
return true;
default:
}
}
-int32_t spvOpcodeGeneratesType(Op op) {
+int32_t spvOpcodeGeneratesType(SpvOp op) {
switch(op) {
- case OpTypeVoid:
- case OpTypeBool:
- case OpTypeInt:
- case OpTypeFloat:
- case OpTypeVector:
- case OpTypeMatrix:
- case OpTypeImage:
- case OpTypeSampler:
- case OpTypeSampledImage:
- case OpTypeArray:
- case OpTypeRuntimeArray:
- case OpTypeStruct:
- case OpTypeOpaque:
- case OpTypePointer:
- case OpTypeFunction:
- case OpTypeEvent:
- case OpTypeDeviceEvent:
- case OpTypeReserveId:
- case OpTypeQueue:
- case OpTypePipe:
- case OpTypeForwardPointer:
+ case SpvOpTypeVoid:
+ case SpvOpTypeBool:
+ case SpvOpTypeInt:
+ case SpvOpTypeFloat:
+ case SpvOpTypeVector:
+ case SpvOpTypeMatrix:
+ case SpvOpTypeImage:
+ case SpvOpTypeSampler:
+ case SpvOpTypeSampledImage:
+ case SpvOpTypeArray:
+ case SpvOpTypeRuntimeArray:
+ case SpvOpTypeStruct:
+ case SpvOpTypeOpaque:
+ case SpvOpTypePointer:
+ case SpvOpTypeFunction:
+ case SpvOpTypeEvent:
+ case SpvOpTypeDeviceEvent:
+ case SpvOpTypeReserveId:
+ case SpvOpTypeQueue:
+ case SpvOpTypePipe:
+ case SpvOpTypeForwardPointer:
return true;
default:;
}
/// @param[in] opcode enumerant value
///
/// @return Opcode word
-uint32_t spvOpcodeMake(uint16_t wordCount, Op opcode);
+uint32_t spvOpcodeMake(uint16_t wordCount, SpvOp opcode);
/// @brief Split the binary opcode into its constituent parts
///
/// @param[in] word binary opcode to split
/// @param[out] wordCount the returned number of words (optional)
/// @param[out] opcode the returned opcode enumerant (optional)
-void spvOpcodeSplit(const uint32_t word, uint16_t *wordCount, Op *opcode);
+void spvOpcodeSplit(const uint32_t word, uint16_t *wordCount, SpvOp *opcode);
/// @brief Find the named Opcode in the table
///
///
/// @return result code
spv_result_t spvOpcodeTableValueLookup(const spv_opcode_table table,
- const Op opcode,
+ const SpvOp opcode,
spv_opcode_desc *pEntry);
/// @brief Get the argument index for the <result-id> operand, if any.
/// @param[in] wordCount the number of words to copy
/// @param[in] endian the endianness of the stream
/// @param[out] pInst the returned instruction
-void spvInstructionCopy(const uint32_t *words, const Op opcode,
+void spvInstructionCopy(const uint32_t *words, const SpvOp opcode,
const uint16_t wordCount, const spv_endianness_t endian,
spv_instruction_t *pInst);
/// @param[in] opcode the opcode
///
/// @return the opcode string
-const char *spvOpcodeString(const Op opcode);
+const char *spvOpcodeString(const SpvOp opcode);
/// @brief Determine if the Opcode is a type
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsType(const Op opcode);
+int32_t spvOpcodeIsType(const SpvOp opcode);
/// @brief Determine if the OpCode is a scalar type
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsScalarType(const Op opcode);
+int32_t spvOpcodeIsScalarType(const SpvOp opcode);
/// @brief Determine if the Opcode is a constant
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsConstant(const Op opcode);
+int32_t spvOpcodeIsConstant(const SpvOp opcode);
/// @brief Determine if the Opcode is a composite type
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsComposite(const Op opcode);
+int32_t spvOpcodeIsComposite(const SpvOp opcode);
/// @brief Deep comparison of type declaration instructions
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsPointer(const Op opcode);
+int32_t spvOpcodeIsPointer(const SpvOp opcode);
/// @brief Determine if the Opcode results in a instantation of a non-void type
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsObject(const Op opcode);
+int32_t spvOpcodeIsObject(const SpvOp opcode);
/// @brief Determine if the scalar type Opcode is nullable
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsBasicTypeNullable(Op opcode);
+int32_t spvOpcodeIsBasicTypeNullable(SpvOp opcode);
/// @brief Determine if instruction is in a basic block
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeIsValue(Op opcode);
+int32_t spvOpcodeIsValue(SpvOp opcode);
/// @brief Determine if the Opcode generates a type
///
/// @param[in] opcode the opcode
///
/// @return zero if false, non-zero otherwise
-int32_t spvOpcodeGeneratesType(Op op);
+int32_t spvOpcodeGeneratesType(SpvOp op);
#endif // LIBSPIRV_OPCODE_H_
static const spv_operand_desc_t sourceLanguageEntries[] = {
{"Unknown",
- SourceLanguageUnknown,
+ SpvSourceLanguageUnknown,
0,
{SPV_OPERAND_TYPE_NONE}},
{"ESSL",
- SourceLanguageESSL,
+ SpvSourceLanguageESSL,
0,
{SPV_OPERAND_TYPE_NONE}},
{"GLSL",
- SourceLanguageGLSL,
+ SpvSourceLanguageGLSL,
0,
{SPV_OPERAND_TYPE_NONE}},
{"OpenCL",
- SourceLanguageOpenCL,
+ SpvSourceLanguageOpenCL,
0,
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t executionModelEntries[] = {
{"Vertex",
- ExecutionModelVertex,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvExecutionModelVertex,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"TessellationControl",
- ExecutionModelTessellationControl,
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvExecutionModelTessellationControl,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"TessellationEvaluation",
- ExecutionModelTessellationEvaluation,
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvExecutionModelTessellationEvaluation,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"Geometry",
- ExecutionModelGeometry,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry),
+ SpvExecutionModelGeometry,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry),
{SPV_OPERAND_TYPE_NONE}},
{"Fragment",
- ExecutionModelFragment,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvExecutionModelFragment,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"GLCompute",
- ExecutionModelGLCompute,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvExecutionModelGLCompute,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Kernel",
- ExecutionModelKernel,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvExecutionModelKernel,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t addressingModelEntries[] = {
{"Logical",
- AddressingModelLogical,
+ SpvAddressingModelLogical,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Physical32",
- AddressingModelPhysical32,
- SPV_CAPABILITY_AS_MASK(CapabilityAddresses),
+ SpvAddressingModelPhysical32,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityAddresses),
{SPV_OPERAND_TYPE_NONE}},
{"Physical64",
- AddressingModelPhysical64,
- SPV_CAPABILITY_AS_MASK(CapabilityAddresses),
+ SpvAddressingModelPhysical64,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityAddresses),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t memoryModelEntries[] = {
{"Simple",
- MemoryModelSimple,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvMemoryModelSimple,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"GLSL450",
- MemoryModelGLSL450,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvMemoryModelGLSL450,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"OpenCL",
- MemoryModelOpenCL,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvMemoryModelOpenCL,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
// Execution mode requiring the given capability and having no operands.
-#define ExecMode0(mode, cap) \
- #mode, ExecutionMode##mode, SPV_CAPABILITY_AS_MASK(Capability##cap), { \
- SPV_OPERAND_TYPE_NONE \
+#define ExecMode0(mode, cap) \
+ #mode, SpvExecutionMode##mode, SPV_CAPABILITY_AS_MASK(SpvCapability##cap), { \
+ SPV_OPERAND_TYPE_NONE \
}
// Execution mode requiring the given capability and having one literal number
// operand.
-#define ExecMode1(mode, cap) \
- #mode, ExecutionMode##mode, SPV_CAPABILITY_AS_MASK(Capability##cap), { \
- SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE \
+#define ExecMode1(mode, cap) \
+ #mode, SpvExecutionMode##mode, SPV_CAPABILITY_AS_MASK(SpvCapability##cap), { \
+ SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE \
}
static const spv_operand_desc_t executionModeEntries[] = {
{ExecMode1(Invocations, Geometry)},
{ExecMode0(DepthLess, Shader)},
{ExecMode0(DepthUnchanged, Shader)},
{"LocalSize",
- ExecutionModeLocalSize,
+ SpvExecutionModeLocalSize,
0,
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER,
SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"LocalSizeHint",
- ExecutionModeLocalSizeHint,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvExecutionModeLocalSizeHint,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_LITERAL_INTEGER,
SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{ExecMode0(InputPoints, Geometry)},
{ExecMode0(InputLines, Geometry)},
{ExecMode0(InputLinesAdjacency, Geometry)},
{"InputTriangles",
- ExecutionModeInputTriangles,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry) |
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvExecutionModeInputTriangles,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry) |
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{ExecMode0(InputTrianglesAdjacency, Geometry)},
{ExecMode0(InputQuads, Tessellation)},
{ExecMode0(InputIsolines, Tessellation)},
{"OutputVertices",
- ExecutionModeOutputVertices,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry) |
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvExecutionModeOutputVertices,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry) |
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{ExecMode0(OutputPoints, Geometry)},
{ExecMode0(OutputLineStrip, Geometry)},
static const spv_operand_desc_t storageClassEntries[] = {
// TODO(dneto): There are more storage classes in Rev32 and later.
{"UniformConstant",
- StorageClassUniformConstant,
+ SpvStorageClassUniformConstant,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Input",
- StorageClassInput,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvStorageClassInput,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Uniform",
- StorageClassUniform,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvStorageClassUniform,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Output",
- StorageClassOutput,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvStorageClassOutput,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"WorkgroupLocal",
- StorageClassWorkgroupLocal,
+ SpvStorageClassWorkgroupLocal,
0,
{SPV_OPERAND_TYPE_NONE}},
{"WorkgroupGlobal",
- StorageClassWorkgroupGlobal,
+ SpvStorageClassWorkgroupGlobal,
0,
{SPV_OPERAND_TYPE_NONE}},
{"PrivateGlobal",
- StorageClassPrivateGlobal,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvStorageClassPrivateGlobal,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Function",
- StorageClassFunction,
+ SpvStorageClassFunction,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Generic",
- StorageClassGeneric,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvStorageClassGeneric,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"PushConstant",
- StorageClassPushConstant,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvStorageClassPushConstant,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"AtomicCounter",
- StorageClassAtomicCounter,
- SPV_CAPABILITY_AS_MASK(CapabilityAtomicStorage),
+ SpvStorageClassAtomicCounter,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityAtomicStorage),
{SPV_OPERAND_TYPE_NONE}},
{"Image",
- StorageClassImage,
+ SpvStorageClassImage,
0,
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t dimensionalityEntries[] = {
{"1D",
- Dim1D,
- SPV_CAPABILITY_AS_MASK(CapabilitySampled1D),
+ SpvDim1D,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilitySampled1D),
{SPV_OPERAND_TYPE_NONE}},
- {"2D", Dim2D, 0, {SPV_OPERAND_TYPE_NONE}},
- {"3D", Dim3D, 0, {SPV_OPERAND_TYPE_NONE}},
+ {"2D", SpvDim2D, 0, {SPV_OPERAND_TYPE_NONE}},
+ {"3D", SpvDim3D, 0, {SPV_OPERAND_TYPE_NONE}},
{"Cube",
- DimCube,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDimCube,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Rect",
- DimRect,
- SPV_CAPABILITY_AS_MASK(CapabilitySampledRect),
+ SpvDimRect,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilitySampledRect),
{SPV_OPERAND_TYPE_NONE}},
{"Buffer",
- DimBuffer,
- SPV_CAPABILITY_AS_MASK(CapabilitySampledBuffer),
+ SpvDimBuffer,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilitySampledBuffer),
{SPV_OPERAND_TYPE_NONE}},
{"InputTarget",
- DimInputTarget,
- SPV_CAPABILITY_AS_MASK(CapabilityInputTarget),
+ SpvDimInputTarget,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityInputTarget),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t samplerAddressingModeEntries[] = {
{"None",
- SamplerAddressingModeNone,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvSamplerAddressingModeNone,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"ClampToEdge",
- SamplerAddressingModeClampToEdge,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvSamplerAddressingModeClampToEdge,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Clamp",
- SamplerAddressingModeClamp,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvSamplerAddressingModeClamp,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Repeat",
- SamplerAddressingModeRepeat,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvSamplerAddressingModeRepeat,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"RepeatMirrored",
- SamplerAddressingModeRepeatMirrored,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvSamplerAddressingModeRepeatMirrored,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t samplerFilterModeEntries[] = {
{"Nearest",
- SamplerFilterModeNearest,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvSamplerFilterModeNearest,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Linear",
- SamplerFilterModeLinear,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvSamplerFilterModeLinear,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t samplerImageFormatEntries[] = {
-#define CASE0(NAME) \
- { \
- #NAME, ImageFormat##NAME, 0, { SPV_OPERAND_TYPE_NONE } \
+#define CASE0(NAME) \
+ { \
+ #NAME, SpvImageFormat##NAME, 0, { SPV_OPERAND_TYPE_NONE } \
}
-#define CASE(NAME, CAP) \
- { \
- #NAME, ImageFormat##NAME, SPV_CAPABILITY_AS_MASK(Capability##CAP), { \
- SPV_OPERAND_TYPE_NONE \
- } \
+#define CASE(NAME, CAP) \
+ { \
+ #NAME, SpvImageFormat##NAME, SPV_CAPABILITY_AS_MASK(SpvCapability##CAP), { \
+ SPV_OPERAND_TYPE_NONE \
+ } \
}
// clang-format off
CASE0(Unknown),
// All image channel orders depend on the Kernel capability.
#define CASE(NAME) \
{ \
- #NAME, ImageChannelOrder##NAME, SPV_CAPABILITY_AS_MASK(CapabilityKernel), \
+ #NAME, SpvImageChannelOrder##NAME, SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel), \
{ \
SPV_OPERAND_TYPE_NONE \
} \
#undef CASE
// All image channel data types depend on the Kernel capability.
-#define CASE(NAME) \
- { \
- #NAME, ImageChannelDataType##NAME, \
- SPV_CAPABILITY_AS_MASK(CapabilityKernel), { \
- SPV_OPERAND_TYPE_NONE \
- } \
+#define CASE(NAME) \
+ { \
+ #NAME, SpvImageChannelDataType##NAME, \
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel), { \
+ SPV_OPERAND_TYPE_NONE \
+ } \
}
static const spv_operand_desc_t imageChannelDataTypeEntries[] = {
CASE(SnormInt8),
static const spv_operand_desc_t imageOperandEntries[] = {
// Rev32 and later adds many more enums.
#define CASE(NAME) \
- #NAME, spv::ImageOperands##NAME##Mask, 0
+ #NAME, SpvImageOperands##NAME##Mask, 0
#define CASE_CAP(NAME, CAP) \
- #NAME, spv::ImageOperands##NAME##Mask, CAP
+ #NAME, SpvImageOperands##NAME##Mask, CAP
#define ID SPV_OPERAND_TYPE_ID
#define NONE SPV_OPERAND_TYPE_NONE
- {"None", spv::ImageOperandsMaskNone, 0, {NONE}},
- {CASE_CAP(Bias, SPV_CAPABILITY_AS_MASK(CapabilityShader)), {ID, NONE}},
+ {"None", SpvImageOperandsMaskNone, 0, {NONE}},
+ {CASE_CAP(Bias, SPV_CAPABILITY_AS_MASK(SpvCapabilityShader)), {ID, NONE}},
{CASE(Lod), {ID, NONE}},
{CASE(Grad), {ID, ID, NONE}},
{CASE(ConstOffset), {ID, NONE}},
- {CASE_CAP(Offset, SPV_CAPABILITY_AS_MASK(CapabilityImageGatherExtended)),
+ {CASE_CAP(Offset, SPV_CAPABILITY_AS_MASK(SpvCapabilityImageGatherExtended)),
{ID, NONE}},
{CASE(ConstOffsets), {ID, NONE}},
{CASE(Sample), {ID, NONE}},
- {CASE_CAP(MinLod, SPV_CAPABILITY_AS_MASK(CapabilityMinLod)), {ID, NONE}},
+ {CASE_CAP(MinLod, SPV_CAPABILITY_AS_MASK(SpvCapabilityMinLod)), {ID, NONE}},
#undef CASE
#undef CASE_CAP
#undef ID
static const spv_operand_desc_t fpFastMathModeEntries[] = {
{"None",
- FPFastMathModeMaskNone,
+ SpvFPFastMathModeMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"NotNaN",
- FPFastMathModeNotNaNMask,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPFastMathModeNotNaNMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NotInf",
- FPFastMathModeNotInfMask,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPFastMathModeNotInfMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NSZ",
- FPFastMathModeNSZMask,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPFastMathModeNSZMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"AllowRecip",
- FPFastMathModeAllowRecipMask,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPFastMathModeAllowRecipMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Fast",
- FPFastMathModeFastMask,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPFastMathModeFastMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t fpRoundingModeEntries[] = {
{"RTE",
- FPRoundingModeRTE,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPRoundingModeRTE,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"RTZ",
- FPRoundingModeRTZ,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPRoundingModeRTZ,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"RTP",
- FPRoundingModeRTP,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPRoundingModeRTP,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"RTN",
- FPRoundingModeRTN,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFPRoundingModeRTN,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t linkageTypeEntries[] = {
{"Export",
- LinkageTypeExport,
- SPV_CAPABILITY_AS_MASK(CapabilityLinkage),
+ SpvLinkageTypeExport,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityLinkage),
{SPV_OPERAND_TYPE_NONE}},
{"Import",
- LinkageTypeImport,
- SPV_CAPABILITY_AS_MASK(CapabilityLinkage),
+ SpvLinkageTypeImport,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityLinkage),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t accessQualifierEntries[] = {
{"ReadOnly",
- AccessQualifierReadOnly,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvAccessQualifierReadOnly,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"WriteOnly",
- AccessQualifierWriteOnly,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvAccessQualifierWriteOnly,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"ReadWrite",
- AccessQualifierReadWrite,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvAccessQualifierReadWrite,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t functionParameterAttributeEntries[] = {
{"Zext",
- FunctionParameterAttributeZext,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeZext,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Sext",
- FunctionParameterAttributeSext,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeSext,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"ByVal",
- FunctionParameterAttributeByVal,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeByVal,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Sret",
- FunctionParameterAttributeSret,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeSret,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NoAlias",
- FunctionParameterAttributeNoAlias,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeNoAlias,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NoCapture",
- FunctionParameterAttributeNoCapture,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeNoCapture,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NoWrite",
- FunctionParameterAttributeNoWrite,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeNoWrite,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NoReadWrite",
- FunctionParameterAttributeNoReadWrite,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvFunctionParameterAttributeNoReadWrite,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t decorationEntries[] = {
{"RelaxedPrecision",
- DecorationRelaxedPrecision,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationRelaxedPrecision,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{
"SpecId",
- DecorationSpecId,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationSpecId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER},
},
{"Block",
- DecorationBlock,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationBlock,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"BufferBlock",
- DecorationBufferBlock,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationBufferBlock,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"RowMajor",
- DecorationRowMajor,
- SPV_CAPABILITY_AS_MASK(CapabilityMatrix),
+ SpvDecorationRowMajor,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityMatrix),
{SPV_OPERAND_TYPE_NONE}},
{"ColMajor",
- DecorationColMajor,
- SPV_CAPABILITY_AS_MASK(CapabilityMatrix),
+ SpvDecorationColMajor,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityMatrix),
{SPV_OPERAND_TYPE_NONE}},
{"ArrayStride",
- DecorationArrayStride,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationArrayStride,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"MatrixStride",
- DecorationMatrixStride,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationMatrixStride,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"GLSLShared",
- DecorationGLSLShared,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationGLSLShared,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"GLSLPacked",
- DecorationGLSLPacked,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationGLSLPacked,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"CPacked",
- DecorationCPacked,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvDecorationCPacked,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"BuiltIn",
- DecorationBuiltIn,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationBuiltIn,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_BUILT_IN, SPV_OPERAND_TYPE_NONE}},
{"Smooth",
- DecorationSmooth,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationSmooth,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"NoPerspective",
- DecorationNoPerspective,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationNoPerspective,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Flat",
- DecorationFlat,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationFlat,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Patch",
- DecorationPatch,
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvDecorationPatch,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"Centroid",
- DecorationCentroid,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationCentroid,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Sample",
- DecorationSample,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationSample,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Invariant",
- DecorationInvariant,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationInvariant,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"Restrict",
- DecorationRestrict,
+ SpvDecorationRestrict,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Aliased",
- DecorationAliased,
+ SpvDecorationAliased,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Volatile",
- DecorationVolatile,
+ SpvDecorationVolatile,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Constant",
- DecorationConstant,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvDecorationConstant,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Coherent",
- DecorationCoherent,
+ SpvDecorationCoherent,
0,
{SPV_OPERAND_TYPE_NONE}},
{"NonWritable",
- DecorationNonWritable,
+ SpvDecorationNonWritable,
0,
{SPV_OPERAND_TYPE_NONE}},
{"NonReadable",
- DecorationNonReadable,
+ SpvDecorationNonReadable,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Uniform",
- DecorationUniform,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationUniform,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"SaturatedConversion",
- DecorationSaturatedConversion,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvDecorationSaturatedConversion,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"Stream",
- DecorationStream,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry),
+ SpvDecorationStream,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"Location",
- DecorationLocation,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationLocation,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"Component",
- DecorationComponent,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationComponent,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"Index",
- DecorationIndex,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationIndex,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"Binding",
- DecorationBinding,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationBinding,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"DescriptorSet",
- DecorationDescriptorSet,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationDescriptorSet,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"Offset",
- DecorationOffset,
+ SpvDecorationOffset,
0,
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"XfbBuffer",
- DecorationXfbBuffer,
- SPV_CAPABILITY_AS_MASK(CapabilityTransformFeedback),
+ SpvDecorationXfbBuffer,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTransformFeedback),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"XfbStride",
- DecorationXfbStride,
- SPV_CAPABILITY_AS_MASK(CapabilityTransformFeedback),
+ SpvDecorationXfbStride,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTransformFeedback),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
{"FuncParamAttr",
- DecorationFuncParamAttr,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvDecorationFuncParamAttr,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE, SPV_OPERAND_TYPE_NONE}},
{"FPRoundingMode",
- DecorationFPRoundingMode,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvDecorationFPRoundingMode,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_FP_ROUNDING_MODE, SPV_OPERAND_TYPE_NONE}},
{"FPFastMathMode",
- DecorationFPFastMathMode,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvDecorationFPFastMathMode,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, SPV_OPERAND_TYPE_NONE}},
{"LinkageAttributes",
- DecorationLinkageAttributes,
- SPV_CAPABILITY_AS_MASK(CapabilityLinkage),
+ SpvDecorationLinkageAttributes,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityLinkage),
{SPV_OPERAND_TYPE_LITERAL_STRING, SPV_OPERAND_TYPE_LINKAGE_TYPE,
SPV_OPERAND_TYPE_NONE}},
{"NoContraction",
- DecorationNoContraction,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvDecorationNoContraction,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"InputTargetIndex",
- DecorationInputTargetIndex,
- SPV_CAPABILITY_AS_MASK(CapabilityShader), // TODO(dneto): Should this be
- // CapabilityInputTarget?
+ SpvDecorationInputTargetIndex,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader), // TODO(dneto): Should this be
+ // SpvCapabilityInputTarget?
{SPV_OPERAND_TYPE_NONE}}, // TODO(dneto): Should this have a literal
// number argument?
{"Alignment",
- DecorationAlignment,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvDecorationAlignment,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t builtInEntries[] = {
{"Position",
- BuiltInPosition,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInPosition,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"PointSize",
- BuiltInPointSize,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInPointSize,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"ClipDistance",
- BuiltInClipDistance,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInClipDistance,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"CullDistance",
- BuiltInCullDistance,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInCullDistance,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"VertexId",
- BuiltInVertexId,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInVertexId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"InstanceId",
- BuiltInInstanceId,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInInstanceId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"PrimitiveId",
- BuiltInPrimitiveId,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry) |
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvBuiltInPrimitiveId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry) |
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"InvocationId",
- BuiltInInvocationId,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry) |
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvBuiltInInvocationId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry) |
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"Layer",
- BuiltInLayer,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry),
+ SpvBuiltInLayer,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry),
{SPV_OPERAND_TYPE_NONE}},
{"ViewportIndex",
- BuiltInViewportIndex,
- SPV_CAPABILITY_AS_MASK(CapabilityGeometry),
+ SpvBuiltInViewportIndex,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry),
{SPV_OPERAND_TYPE_NONE}},
{"TessLevelOuter",
- BuiltInTessLevelOuter,
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvBuiltInTessLevelOuter,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"TessLevelInner",
- BuiltInTessLevelInner,
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvBuiltInTessLevelInner,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"TessCoord",
- BuiltInTessCoord,
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvBuiltInTessCoord,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"PatchVertices",
- BuiltInPatchVertices,
- SPV_CAPABILITY_AS_MASK(CapabilityTessellation),
+ SpvBuiltInPatchVertices,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTessellation),
{SPV_OPERAND_TYPE_NONE}},
{"FragCoord",
- BuiltInFragCoord,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInFragCoord,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"PointCoord",
- BuiltInPointCoord,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInPointCoord,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"FrontFacing",
- BuiltInFrontFacing,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInFrontFacing,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"SampleId",
- BuiltInSampleId,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInSampleId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"SamplePosition",
- BuiltInSamplePosition,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInSamplePosition,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"SampleMask",
- BuiltInSampleMask,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInSampleMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"FragColor",
- BuiltInFragColor,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInFragColor,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"FragDepth",
- BuiltInFragDepth,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInFragDepth,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"HelperInvocation",
- BuiltInHelperInvocation,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInHelperInvocation,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"NumWorkgroups",
- BuiltInNumWorkgroups,
+ SpvBuiltInNumWorkgroups,
0,
{SPV_OPERAND_TYPE_NONE}},
{"WorkgroupSize",
- BuiltInWorkgroupSize,
+ SpvBuiltInWorkgroupSize,
0,
{SPV_OPERAND_TYPE_NONE}},
{"WorkgroupId",
- BuiltInWorkgroupId,
+ SpvBuiltInWorkgroupId,
0,
{SPV_OPERAND_TYPE_NONE}},
{"LocalInvocationId",
- BuiltInLocalInvocationId,
+ SpvBuiltInLocalInvocationId,
0,
{SPV_OPERAND_TYPE_NONE}},
{"GlobalInvocationId",
- BuiltInGlobalInvocationId,
+ SpvBuiltInGlobalInvocationId,
0,
{SPV_OPERAND_TYPE_NONE}},
{"LocalInvocationIndex",
- BuiltInLocalInvocationIndex,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInLocalInvocationIndex,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"WorkDim",
- BuiltInWorkDim,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInWorkDim,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"GlobalSize",
- BuiltInGlobalSize,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInGlobalSize,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"EnqueuedWorkgroupSize",
- BuiltInEnqueuedWorkgroupSize,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInEnqueuedWorkgroupSize,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"GlobalOffset",
- BuiltInGlobalOffset,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInGlobalOffset,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"GlobalLinearId",
- BuiltInGlobalLinearId,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInGlobalLinearId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"WorkgroupLinearId",
- BuiltInWorkgroupLinearId,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInWorkgroupLinearId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"SubgroupSize",
- BuiltInSubgroupSize,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInSubgroupSize,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"SubgroupMaxSize",
- BuiltInSubgroupMaxSize,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInSubgroupMaxSize,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NumSubgroups",
- BuiltInNumSubgroups,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInNumSubgroups,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"NumEnqueuedSubgroups",
- BuiltInNumEnqueuedSubgroups,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInNumEnqueuedSubgroups,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"SubgroupId",
- BuiltInSubgroupId,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInSubgroupId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"SubgroupLocalInvocationId",
- BuiltInSubgroupLocalInvocationId,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvBuiltInSubgroupLocalInvocationId,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"VertexIndex",
- BuiltInVertexIndex,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInVertexIndex,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"InstanceIndex",
- BuiltInInstanceIndex,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvBuiltInInstanceIndex,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t selectionControlEntries[] = {
{"None",
- SelectionControlMaskNone,
+ SpvSelectionControlMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Flatten",
- SelectionControlFlattenMask,
+ SpvSelectionControlFlattenMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"DontFlatten",
- SelectionControlDontFlattenMask,
+ SpvSelectionControlDontFlattenMask,
0,
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t loopControlEntries[] = {
{"None",
- LoopControlMaskNone,
+ SpvLoopControlMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Unroll",
- LoopControlUnrollMask,
+ SpvLoopControlUnrollMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"DontUnroll",
- LoopControlDontUnrollMask,
+ SpvLoopControlDontUnrollMask,
0,
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t functionControlEntries[] = {
{"None",
- FunctionControlMaskNone,
+ SpvFunctionControlMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Inline",
- FunctionControlInlineMask,
+ SpvFunctionControlInlineMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"DontInline",
- FunctionControlDontInlineMask,
+ SpvFunctionControlDontInlineMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Pure",
- FunctionControlPureMask,
+ SpvFunctionControlPureMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Const",
- FunctionControlConstMask,
+ SpvFunctionControlConstMask,
0,
{SPV_OPERAND_TYPE_NONE}},
};
// Put the Relaxed entry first so that the disassembler
// will prefer to emit "Relaxed".
{"Relaxed",
- MemorySemanticsMaskNone,
+ SpvMemorySemanticsMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"None",
- MemorySemanticsMaskNone,
+ SpvMemorySemanticsMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"SequentiallyConsistent",
- MemorySemanticsSequentiallyConsistentMask,
+ SpvMemorySemanticsSequentiallyConsistentMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Acquire",
- MemorySemanticsAcquireMask,
+ SpvMemorySemanticsAcquireMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Release",
- MemorySemanticsReleaseMask,
+ SpvMemorySemanticsReleaseMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"UniformMemory",
- MemorySemanticsUniformMemoryMask,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvMemorySemanticsUniformMemoryMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{"SubgroupMemory",
- MemorySemanticsSubgroupMemoryMask,
+ SpvMemorySemanticsSubgroupMemoryMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"WorkgroupLocalMemory",
- MemorySemanticsWorkgroupLocalMemoryMask,
+ SpvMemorySemanticsWorkgroupLocalMemoryMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"WorkgroupGlobalMemory",
- MemorySemanticsWorkgroupGlobalMemoryMask,
+ SpvMemorySemanticsWorkgroupGlobalMemoryMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{"AtomicCounterMemory",
- MemorySemanticsAtomicCounterMemoryMask,
- SPV_CAPABILITY_AS_MASK(CapabilityShader),
+ SpvMemorySemanticsAtomicCounterMemoryMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityShader),
{SPV_OPERAND_TYPE_NONE}},
{
"ImageMemory",
- MemorySemanticsImageMemoryMask,
+ SpvMemorySemanticsImageMemoryMask,
0,
{SPV_OPERAND_TYPE_NONE},
},
static const spv_operand_desc_t memoryAccessEntries[] = {
{"None",
- MemoryAccessMaskNone,
+ SpvMemoryAccessMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Volatile",
- MemoryAccessVolatileMask,
+ SpvMemoryAccessVolatileMask,
0,
{SPV_OPERAND_TYPE_NONE}},
{
"Aligned",
- MemoryAccessAlignedMask,
+ SpvMemoryAccessAlignedMask,
0,
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE},
},
{"Nontemporal",
- MemoryAccessNontemporalMask,
+ SpvMemoryAccessNontemporalMask,
0,
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t scopeEntries[] = {
{"CrossDevice",
- ScopeCrossDevice,
+ SpvScopeCrossDevice,
0,
{SPV_OPERAND_TYPE_NONE}},
- {"Device", ScopeDevice, 0, {SPV_OPERAND_TYPE_NONE}},
+ {"Device", SpvScopeDevice, 0, {SPV_OPERAND_TYPE_NONE}},
{"Workgroup",
- ScopeWorkgroup,
+ SpvScopeWorkgroup,
0,
{SPV_OPERAND_TYPE_NONE}},
{"Subgroup",
- ScopeSubgroup,
+ SpvScopeSubgroup,
0,
{SPV_OPERAND_TYPE_NONE}},
{
"Invocation",
- ScopeInvocation,
+ SpvScopeInvocation,
0,
{SPV_OPERAND_TYPE_NONE},
},
static const spv_operand_desc_t groupOperationEntries[] = {
{"Reduce",
- GroupOperationReduce,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvGroupOperationReduce,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"InclusiveScan",
- GroupOperationInclusiveScan,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvGroupOperationInclusiveScan,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"ExclusiveScan",
- GroupOperationExclusiveScan,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvGroupOperationExclusiveScan,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t kernelKernelEnqueueFlagssEntries[] = {
{"NoWait",
- KernelEnqueueFlagsNoWait,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvKernelEnqueueFlagsNoWait,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"WaitKernel",
- KernelEnqueueFlagsWaitKernel,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvKernelEnqueueFlagsWaitKernel,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
{"WaitWorkGroup",
- KernelEnqueueFlagsWaitWorkGroup,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvKernelEnqueueFlagsWaitWorkGroup,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
static const spv_operand_desc_t kernelProfilingInfoEntries[] = {
{"None",
- KernelProfilingInfoMaskNone,
+ SpvKernelProfilingInfoMaskNone,
0,
{SPV_OPERAND_TYPE_NONE}},
{"CmdExecTime",
- KernelProfilingInfoCmdExecTimeMask,
- SPV_CAPABILITY_AS_MASK(CapabilityKernel),
+ SpvKernelProfilingInfoCmdExecTimeMask,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityKernel),
{SPV_OPERAND_TYPE_NONE}},
};
// A macro for defining a capability that doesn't depend on another capability.
-#define CASE(NAME) \
- { \
- #NAME, Capability##NAME, 0, { SPV_OPERAND_TYPE_NONE } \
+#define CASE(NAME) \
+ { \
+ #NAME, SpvCapability##NAME, 0, { SPV_OPERAND_TYPE_NONE } \
}
// A macro for defining a capability that depends on another.
-#define CASE_CAP(NAME, CAP) \
- { \
- #NAME, Capability##NAME, SPV_CAPABILITY_AS_MASK(Capability##CAP), { \
- SPV_OPERAND_TYPE_NONE \
- } \
+#define CASE_CAP(NAME, CAP) \
+ { \
+ #NAME, SpvCapability##NAME, SPV_CAPABILITY_AS_MASK(SpvCapability##CAP), { \
+ SPV_OPERAND_TYPE_NONE \
+ } \
}
static const spv_operand_desc_t capabilityInfoEntries[] = {
// The encoding for OpConstant, OpSpecConstant and OpSwitch all
// depend on either their own result-id or the result-id of
// one of their parameters.
- if (OpConstant == pInst->opcode || OpSpecConstant == pInst->opcode) {
+ if (SpvOpConstant == pInst->opcode ||
+ SpvOpSpecConstant == pInst->opcode) {
// Special cases for encoding possibly non-32-bit literals here.
expected_type =
context->getTypeOfTypeGeneratingValue(pInst->resultTypeId);
<< "Type for " << opcode_name
<< " must be a scalar floating point or integer type";
}
- } else if (pInst->opcode == OpSwitch) {
+ } else if (pInst->opcode == SpvOpSwitch) {
// We need to know the type of the selector.
expected_type = context->getTypeOfValueInstruction(pInst->words[1]);
if (!libspirv::isScalarIntegral(expected_type)) {
}
// NOTE: Special case for extended instruction library import
- if (OpExtInstImport == pInst->opcode) {
+ if (SpvOpExtInstImport == pInst->opcode) {
pInst->extInstType = spvExtInstImportTypeGet(literal.value.str);
}
<< "Value " << value << " has already been used to generate a type";
}
- if (pInst->opcode == OpTypeInt) {
+ if (pInst->opcode == SpvOpTypeInt) {
if (pInst->words.size() != 4)
return diagnostic() << "Invalid OpTypeInt instruction";
types_[value] = {pInst->words[2], pInst->words[3] != 0,
IdTypeClass::kScalarIntegerType};
- } else if (pInst->opcode == OpTypeFloat) {
+ } else if (pInst->opcode == SpvOpTypeFloat) {
if (pInst->words.size() != 3)
return diagnostic() << "Invalid OpTypeFloat instruction";
types_[value] = {pInst->words[2], false, IdTypeClass::kScalarFloatType};
for (uint64_t instIndex = 0; instIndex < instCount; ++instIndex) {
const uint32_t *words = pInsts[instIndex].words.data();
uint16_t wordCount;
- Op opcode;
+ SpvOp opcode;
spvOpcodeSplit(words[0], &wordCount, &opcode);
spv_opcode_desc opcodeEntry = nullptr;
for (uint64_t instIndex = 0; instIndex < count; ++instIndex) {
const uint32_t *words = pInsts[instIndex].words.data();
- Op opcode;
+ SpvOp opcode;
spvOpcodeSplit(words[0], nullptr, &opcode);
spv_opcode_desc opcodeEntry = nullptr;
uint64_t index = SPV_INDEX_INSTRUCTION;
while (index < binary->wordCount) {
uint16_t wordCount;
- Op opcode;
+ SpvOp opcode;
spvOpcodeSplit(spvFixWord(binary->code[index], endian), &wordCount,
&opcode);
spv_instruction_t inst;
typedef struct spv_id_info_t {
uint32_t id;
- Op opcode;
+ SpvOp opcode;
const spv_instruction_t *inst;
spv_position_t position;
} spv_id_info_t;
bool isValid(const spv_instruction_t *inst);
- template <Op>
+ template <SpvOp>
bool isValid(const spv_instruction_t *inst, const spv_opcode_desc);
std::unordered_map<uint32_t, spv_id_info_t>::iterator find(
#if 0
template <>
-bool idUsage::isValid<OpUndef>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpUndef>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
assert(0 && "Unimplemented!");
return false;
}
#endif
template <>
-bool idUsage::isValid<OpName>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpName>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto targetIndex = 1;
auto target = find(inst->words[targetIndex]);
spvCheck(!found(target), DIAG(targetIndex) << "OpName Target <id> '"
}
template <>
-bool idUsage::isValid<OpMemberName>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpMemberName>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto typeIndex = 1;
auto type = find(inst->words[typeIndex]);
spvCheck(!found(type), DIAG(typeIndex) << "OpMemberName Type <id> '"
<< inst->words[typeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeStruct != type->second.opcode,
+ spvCheck(SpvOpTypeStruct != type->second.opcode,
DIAG(typeIndex) << "OpMemberName Type <id> '"
<< inst->words[typeIndex]
<< "' is not a struct type.";
}
template <>
-bool idUsage::isValid<OpLine>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpLine>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto fileIndex = 1;
auto file = find(inst->words[fileIndex]);
spvCheck(!found(file), DIAG(fileIndex) << "OpLine Target <id> '"
<< inst->words[fileIndex]
<< "' is not defined.";
return false);
- spvCheck(OpString != file->second.opcode,
+ spvCheck(SpvOpString != file->second.opcode,
DIAG(fileIndex) << "OpLine Target <id> '" << inst->words[fileIndex]
<< "' is not an OpString.";
return false);
}
template <>
-bool idUsage::isValid<OpDecorate>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpDecorate>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto targetIndex = 1;
auto target = find(inst->words[targetIndex]);
spvCheck(!found(target), DIAG(targetIndex) << "OpDecorate Target <id> '"
}
template <>
-bool idUsage::isValid<OpMemberDecorate>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpMemberDecorate>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto structTypeIndex = 1;
auto structType = find(inst->words[structTypeIndex]);
spvCheck(!found(structType), DIAG(structTypeIndex)
<< inst->words[structTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeStruct != structType->second.inst->opcode,
+ spvCheck(SpvOpTypeStruct != structType->second.inst->opcode,
DIAG(structTypeIndex) << "OpMemberDecorate Structure type <id> '"
<< inst->words[structTypeIndex]
<< "' is not a struct type.";
}
template <>
-bool idUsage::isValid<OpGroupDecorate>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpGroupDecorate>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto decorationGroupIndex = 1;
auto decorationGroup = find(inst->words[decorationGroupIndex]);
spvCheck(!found(decorationGroup),
<< "OpGroupDecorate Decoration group <id> '"
<< inst->words[decorationGroupIndex] << "' is not defined.";
return false);
- spvCheck(OpDecorationGroup != decorationGroup->second.opcode,
+ spvCheck(SpvOpDecorationGroup != decorationGroup->second.opcode,
DIAG(decorationGroupIndex)
<< "OpGroupDecorate Decoration group <id> '"
<< inst->words[decorationGroupIndex]
#if 0
template <>
-bool idUsage::isValid<OpGroupMemberDecorate>(
+bool idUsage::isValid<SpvOpGroupMemberDecorate>(
const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {}
#endif
#if 0
template <>
-bool idUsage::isValid<OpExtInst>(const spv_instruction_t *inst,
- const spv_opcode_desc opcodeEntry) {}
+bool idUsage::isValid<SpvOpExtInst>(const spv_instruction_t *inst,
+ const spv_opcode_desc opcodeEntry) {}
#endif
template <>
-bool idUsage::isValid<OpEntryPoint>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpEntryPoint>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto entryPointIndex = 2;
auto entryPoint = find(inst->words[entryPointIndex]);
spvCheck(!found(entryPoint), DIAG(entryPointIndex)
<< inst->words[entryPointIndex]
<< "' is not defined.";
return false);
- spvCheck(OpFunction != entryPoint->second.opcode,
+ spvCheck(SpvOpFunction != entryPoint->second.opcode,
DIAG(entryPointIndex) << "OpEntryPoint Entry Point <id> '"
<< inst->words[entryPointIndex]
<< "' is not a function.";
return false);
auto returnType = find(entryPoint->second.inst->words[1]);
spvCheck(!found(returnType), assert(0 && "Unreachable!"));
- spvCheck(OpTypeVoid != returnType->second.opcode,
+ spvCheck(SpvOpTypeVoid != returnType->second.opcode,
DIAG(entryPointIndex) << "OpEntryPoint Entry Point <id> '"
<< inst->words[entryPointIndex]
<< "'s function return type is not void.";
}
template <>
-bool idUsage::isValid<OpExecutionMode>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpExecutionMode>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto entryPointIndex = 1;
auto entryPoint = find(inst->words[entryPointIndex]);
spvCheck(!found(entryPoint), DIAG(entryPointIndex)
spvCheck(!foundUses(entryPointUses), assert(0 && "Unreachable!"));
bool foundEntryPointUse = false;
for (auto use : entryPointUses->second) {
- if (OpEntryPoint == use.opcode) {
+ if (SpvOpEntryPoint == use.opcode) {
foundEntryPointUse = true;
}
}
}
template <>
-bool idUsage::isValid<OpTypeVector>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypeVector>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto componentIndex = 2;
auto componentType = find(inst->words[componentIndex]);
spvCheck(!found(componentType), DIAG(componentIndex)
}
template <>
-bool idUsage::isValid<OpTypeMatrix>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypeMatrix>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto columnTypeIndex = 2;
auto columnType = find(inst->words[columnTypeIndex]);
spvCheck(!found(columnType), DIAG(columnTypeIndex)
<< inst->words[columnTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeVector != columnType->second.opcode,
+ spvCheck(SpvOpTypeVector != columnType->second.opcode,
DIAG(columnTypeIndex) << "OpTypeMatrix Column Type <id> '"
<< inst->words[columnTypeIndex]
<< "' is not a vector.";
}
template <>
-bool idUsage::isValid<OpTypeSampler>(const spv_instruction_t *,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypeSampler>(const spv_instruction_t *,
+ const spv_opcode_desc) {
// OpTypeSampler takes no arguments in Rev31 and beyond.
return true;
}
template <>
-bool idUsage::isValid<OpTypeArray>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypeArray>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto elementTypeIndex = 2;
auto elementType = find(inst->words[elementTypeIndex]);
spvCheck(!found(elementType), DIAG(elementTypeIndex)
<< inst->words[lengthIndex]
<< "' is not defined.";
return false);
- spvCheck(OpConstant != length->second.opcode &&
- OpSpecConstant != length->second.opcode,
+ spvCheck(SpvOpConstant != length->second.opcode &&
+ SpvOpSpecConstant != length->second.opcode,
DIAG(lengthIndex) << "OpTypeArray Length <id> '"
<< inst->words[lengthIndex]
<< "' is not a scalar constant type.";
<< inst->words[constResultTypeIndex]
<< "' result type is not defined.";
return false);
- spvCheck(OpTypeInt != constResultType->second.opcode,
+ spvCheck(SpvOpTypeInt != constResultType->second.opcode,
DIAG(lengthIndex) << "OpTypeArray Length <id> '"
<< inst->words[lengthIndex]
<< "' is not a constant integer type.";
}
template <>
-bool idUsage::isValid<OpTypeRuntimeArray>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypeRuntimeArray>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto elementTypeIndex = 2;
auto elementType = find(inst->words[elementTypeIndex]);
spvCheck(!found(elementType), DIAG(elementTypeIndex)
}
template <>
-bool idUsage::isValid<OpTypeStruct>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypeStruct>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
for (size_t memberTypeIndex = 2; memberTypeIndex < inst->words.size();
++memberTypeIndex) {
auto memberType = find(inst->words[memberTypeIndex]);
}
template <>
-bool idUsage::isValid<OpTypePointer>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypePointer>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto typeIndex = 3;
auto type = find(inst->words[typeIndex]);
spvCheck(!found(type), DIAG(typeIndex) << "OpTypePointer Type <id> '"
}
template <>
-bool idUsage::isValid<OpTypeFunction>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypeFunction>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto returnTypeIndex = 2;
auto returnType = find(inst->words[returnTypeIndex]);
spvCheck(!found(returnType), DIAG(returnTypeIndex)
}
template <>
-bool idUsage::isValid<OpTypePipe>(const spv_instruction_t *,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpTypePipe>(const spv_instruction_t *,
+ const spv_opcode_desc) {
// OpTypePipe has no ID arguments.
return true;
}
template <>
-bool idUsage::isValid<OpConstantTrue>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpConstantTrue>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[resultTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeBool != resultType->second.opcode,
+ spvCheck(SpvOpTypeBool != resultType->second.opcode,
DIAG(resultTypeIndex) << "OpConstantTrue Result Type <id> '"
<< inst->words[resultTypeIndex]
<< "' is not a boolean type.";
}
template <>
-bool idUsage::isValid<OpConstantFalse>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpConstantFalse>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[resultTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeBool != resultType->second.opcode,
+ spvCheck(SpvOpTypeBool != resultType->second.opcode,
DIAG(resultTypeIndex) << "OpConstantFalse Result Type <id> '"
<< inst->words[resultTypeIndex]
<< "' is not a boolean type.";
}
template <>
-bool idUsage::isValid<OpConstant>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpConstant>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
}
template <>
-bool idUsage::isValid<OpConstantComposite>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpConstantComposite>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
uint32_t constituentCount = inst->words.size() - 3;
switch (resultType->second.opcode) {
- case OpTypeVector: {
+ case SpvOpTypeVector: {
auto componentCount = resultType->second.inst->words[3];
spvCheck(
componentCount != constituentCount,
return false);
}
} break;
- case OpTypeMatrix: {
+ case SpvOpTypeMatrix: {
auto columnCount = resultType->second.inst->words[3];
spvCheck(
columnCount != constituentCount,
<< "OpConstantComposite Constituent <id> '"
<< inst->words[constituentIndex] << "' is not defined.";
return false);
- spvCheck(OpConstantComposite != constituent->second.opcode,
+ spvCheck(SpvOpConstantComposite != constituent->second.opcode,
DIAG(constituentIndex)
<< "OpConstantComposite Constituent <id> '"
<< inst->words[constituentIndex]
return false);
}
} break;
- case OpTypeArray: {
+ case SpvOpTypeArray: {
auto elementType = find(resultType->second.inst->words[2]);
spvCheck(!found(elementType), assert(0 && "Unreachable!"));
auto length = find(resultType->second.inst->words[3]);
return false);
}
} break;
- case OpTypeStruct: {
+ case SpvOpTypeStruct: {
uint32_t memberCount = resultType->second.inst->words.size() - 2;
spvCheck(memberCount != constituentCount,
DIAG(resultTypeIndex)
}
template <>
-bool idUsage::isValid<OpConstantSampler>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpConstantSampler>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[resultTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeSampler != resultType->second.opcode,
+ spvCheck(SpvOpTypeSampler != resultType->second.opcode,
DIAG(resultTypeIndex) << "OpConstantSampler Result Type <id> '"
<< inst->words[resultTypeIndex]
<< "' is not a sampler type.";
}
template <>
-bool idUsage::isValid<OpConstantNull>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpConstantNull>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< "' can not be null.";
return false);
} break;
- case OpTypeVector: {
+ case SpvOpTypeVector: {
auto type = find(resultType->second.inst->words[2]);
spvCheck(!found(type), assert(0 && "Unreachable!"));
spvCheck(!spvOpcodeIsBasicTypeNullable(type->second.inst->opcode),
<< "'s vector component type can not be null.";
return false);
} break;
- case OpTypeArray: {
+ case SpvOpTypeArray: {
auto type = find(resultType->second.inst->words[2]);
spvCheck(!found(type), assert(0 && "Unreachable!"));
spvCheck(!spvOpcodeIsBasicTypeNullable(type->second.inst->opcode),
<< "'s array element type can not be null.";
return false);
} break;
- case OpTypeMatrix: {
+ case SpvOpTypeMatrix: {
auto columnType = find(resultType->second.inst->words[2]);
spvCheck(!found(columnType), assert(0 && "Unreachable!"));
auto type = find(columnType->second.inst->words[2]);
<< "'s matrix component type cna not be null.";
return false);
} break;
- case OpTypeStruct: {
+ case SpvOpTypeStruct: {
for (size_t elementIndex = 2;
elementIndex < resultType->second.inst->words.size(); ++elementIndex) {
auto element = find(resultType->second.inst->words[elementIndex]);
}
template <>
-bool idUsage::isValid<OpSpecConstantTrue>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpSpecConstantTrue>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[resultTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeBool != resultType->second.opcode,
+ spvCheck(SpvOpTypeBool != resultType->second.opcode,
DIAG(resultTypeIndex) << "OpSpecConstantTrue Result Type <id> '"
<< inst->words[resultTypeIndex]
<< "' is not a boolean type.";
}
template <>
-bool idUsage::isValid<OpSpecConstantFalse>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpSpecConstantFalse>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[resultTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeBool != resultType->second.opcode,
+ spvCheck(SpvOpTypeBool != resultType->second.opcode,
DIAG(resultTypeIndex) << "OpSpecConstantFalse Result Type <id> '"
<< inst->words[resultTypeIndex]
<< "' is not a boolean type.";
}
template <>
-bool idUsage::isValid<OpSpecConstant>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpSpecConstant>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
#if 0
template <>
-bool idUsage::isValid<OpSpecConstantComposite>(
+bool idUsage::isValid<SpvOpSpecConstantComposite>(
const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {}
#endif
#if 0
template <>
-bool idUsage::isValid<OpSpecConstantOp>(const spv_instruction_t *inst) {}
+bool idUsage::isValid<SpvOpSpecConstantOp>(const spv_instruction_t *inst) {}
#endif
template <>
-bool idUsage::isValid<OpVariable>(const spv_instruction_t *inst,
- const spv_opcode_desc opcodeEntry) {
+bool idUsage::isValid<SpvOpVariable>(const spv_instruction_t *inst,
+ const spv_opcode_desc opcodeEntry) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[resultTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypePointer != resultType->second.opcode,
+ spvCheck(SpvOpTypePointer != resultType->second.opcode,
DIAG(resultTypeIndex) << "OpVariable Result Type <id> '"
<< inst->words[resultTypeIndex]
<< "' is not a pointer type.";
}
template <>
-bool idUsage::isValid<OpLoad>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpLoad>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
}
template <>
-bool idUsage::isValid<OpStore>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpStore>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto pointerIndex = 1;
auto pointer = find(inst->words[pointerIndex]);
spvCheck(!found(pointer), DIAG(pointerIndex) << "OpStore Pointer <id> '"
spvCheck(!found(pointerType), assert(0 && "Unreachable!"));
auto type = find(pointerType->second.inst->words[3]);
spvCheck(!found(type), assert(0 && "Unreachable!"));
- spvCheck(OpTypeVoid == type->second.opcode, DIAG(pointerIndex)
+ spvCheck(SpvOpTypeVoid == type->second.opcode, DIAG(pointerIndex)
<< "OpStore Pointer <id> '"
<< inst->words[pointerIndex]
<< "'s type is void.";
return false);
auto objectType = find(object->second.inst->words[1]);
spvCheck(!found(objectType), assert(0 && "Unreachable!"));
- spvCheck(OpTypeVoid == objectType->second.opcode,
+ spvCheck(SpvOpTypeVoid == objectType->second.opcode,
DIAG(objectIndex) << "OpStore Object <id> '"
<< inst->words[objectIndex] << "'s type is void.";
return false);
}
template <>
-bool idUsage::isValid<OpCopyMemory>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpCopyMemory>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto targetIndex = 1;
auto target = find(inst->words[targetIndex]);
spvCheck(!found(target), DIAG(targetIndex) << "OpCopyMemory Target <id> '"
}
template <>
-bool idUsage::isValid<OpCopyMemorySized>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpCopyMemorySized>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto targetIndex = 1;
auto target = find(inst->words[targetIndex]);
spvCheck(!found(target),
return false);
auto targetPointerType = find(target->second.inst->words[1]);
spvCheck(!found(targetPointerType), assert(0 && "Unreachable!"));
- spvCheck(OpTypePointer != targetPointerType->second.opcode,
+ spvCheck(SpvOpTypePointer != targetPointerType->second.opcode,
DIAG(targetIndex) << "OpCopyMemorySized Target <id> '"
<< inst->words[targetIndex]
<< "' is not a pointer.";
return false);
auto sourcePointerType = find(source->second.inst->words[1]);
spvCheck(!found(sourcePointerType), assert(0 && "Unreachable!"));
- spvCheck(OpTypePointer != sourcePointerType->second.opcode,
+ spvCheck(SpvOpTypePointer != sourcePointerType->second.opcode,
DIAG(sourceIndex) << "OpCopyMemorySized Source <id> '"
<< inst->words[sourceIndex]
<< "' is not a pointer.";
// TODO: The following opcode's are assumed to be valid, refer to the
// following bug https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13871 for
// clarification
- case OpConstant:
- case OpSpecConstant: {
+ case SpvOpConstant:
+ case SpvOpSpecConstant: {
auto sizeType = find(size->second.inst->words[1]);
spvCheck(!found(sizeType), assert(0 && "Unreachable!"));
- spvCheck(OpTypeInt != sizeType->second.opcode,
+ spvCheck(SpvOpTypeInt != sizeType->second.opcode,
DIAG(sizeIndex) << "OpCopyMemorySized Size <id> '"
<< inst->words[sizeIndex]
<< "'s type is not an integer type.";
return false);
} break;
- case OpVariable: {
+ case SpvOpVariable: {
auto pointerType = find(size->second.inst->words[1]);
spvCheck(!found(pointerType), assert(0 && "Unreachable!"));
auto sizeType = find(pointerType->second.inst->words[1]);
spvCheck(!found(sizeType), assert(0 && "Unreachable!"));
- spvCheck(OpTypeInt != sizeType->second.opcode,
+ spvCheck(SpvOpTypeInt != sizeType->second.opcode,
DIAG(sizeIndex) << "OpCopyMemorySized Size <id> '"
<< inst->words[sizeIndex]
<< "'s variable type is not an integer type.";
#if 0
template <>
-bool idUsage::isValid<OpAccessChain>(const spv_instruction_t *inst,
- const spv_opcode_desc opcodeEntry) {}
+bool idUsage::isValid<SpvOpAccessChain>(const spv_instruction_t *inst,
+ const spv_opcode_desc opcodeEntry) {}
#endif
#if 0
template <>
-bool idUsage::isValid<OpInBoundsAccessChain>(
+bool idUsage::isValid<SpvOpInBoundsAccessChain>(
const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {}
#endif
#if 0
template <>
-bool idUsage::isValid<OpArrayLength>(const spv_instruction_t *inst,
- const spv_opcode_desc opcodeEntry) {}
+bool idUsage::isValid<SpvOpArrayLength>(const spv_instruction_t *inst,
+ const spv_opcode_desc opcodeEntry) {}
#endif
#if 0
template <>
-bool idUsage::isValid<OpImagePointer>(const spv_instruction_t *inst,
- const spv_opcode_desc opcodeEntry) {}
+bool idUsage::isValid<SpvOpImagePointer>(const spv_instruction_t *inst,
+ const spv_opcode_desc opcodeEntry) {}
#endif
#if 0
template <>
-bool idUsage::isValid<OpGenericPtrMemSemantics>(
+bool idUsage::isValid<SpvOpGenericPtrMemSemantics>(
const spv_instruction_t *inst, const spv_opcode_desc opcodeEntry) {}
#endif
template <>
-bool idUsage::isValid<OpFunction>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpFunction>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[functionTypeIndex]
<< "' is not defined.";
return false);
- spvCheck(OpTypeFunction != functionType->second.opcode,
+ spvCheck(SpvOpTypeFunction != functionType->second.opcode,
DIAG(functionTypeIndex) << "OpFunction Function Type <id> '"
<< inst->words[functionTypeIndex]
<< "' is not a function type.";
}
template <>
-bool idUsage::isValid<OpFunctionParameter>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpFunctionParameter>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
// NOTE: Find OpFunction & ensure OpFunctionParameter is not out of place.
size_t paramIndex = 0;
while (firstInst != function) {
- spvCheck(OpFunction != function->opcode &&
- OpFunctionParameter != function->opcode,
+ spvCheck(SpvOpFunction != function->opcode &&
+ SpvOpFunctionParameter != function->opcode,
DIAG(0) << "OpFunctionParameter is not preceded by OpFunction or "
"OpFunctionParameter sequence.";
return false);
- if (OpFunction == function->opcode) {
+ if (SpvOpFunction == function->opcode) {
break;
} else {
paramIndex++;
}
template <>
-bool idUsage::isValid<OpFunctionCall>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpFunctionCall>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto resultTypeIndex = 1;
auto resultType = find(inst->words[resultTypeIndex]);
spvCheck(!found(resultType), DIAG(resultTypeIndex)
<< inst->words[functionIndex]
<< "' is not defined.";
return false);
- spvCheck(OpFunction != function->second.opcode,
+ spvCheck(SpvOpFunction != function->second.opcode,
DIAG(functionIndex) << "OpFunctionCall Function <id> '"
<< inst->words[functionIndex]
<< "' is not a function.";
#endif
template <>
-bool idUsage::isValid<OpReturnValue>(const spv_instruction_t *inst,
- const spv_opcode_desc) {
+bool idUsage::isValid<SpvOpReturnValue>(const spv_instruction_t *inst,
+ const spv_opcode_desc) {
auto valueIndex = 1;
auto value = find(inst->words[valueIndex]);
spvCheck(!found(value), DIAG(valueIndex) << "OpReturnValue Value <id> '"
// NOTE: Find OpFunction
const spv_instruction_t *function = inst - 1;
while (firstInst != function) {
- spvCheck(OpFunction == function->opcode, break);
+ spvCheck(SpvOpFunction == function->opcode, break);
function--;
}
- spvCheck(OpFunction != function->opcode,
+ spvCheck(SpvOpFunction != function->opcode,
DIAG(valueIndex) << "OpReturnValue is not in a basic block.";
return false);
auto returnType = find(function->words[1]);
spvCheck(!found(returnType), assert(0 && "Unreachable!"));
- if (OpTypePointer == valueType->second.opcode) {
+ if (SpvOpTypePointer == valueType->second.opcode) {
auto pointerValueType = find(valueType->second.inst->words[3]);
spvCheck(!found(pointerValueType), assert(0 && "Unreachable!"));
spvCheck(!spvOpcodeAreTypesEqual(returnType->second.inst,
spv_opcode_desc opcodeEntry = nullptr;
spvCheck(spvOpcodeTableValueLookup(opcodeTable, inst->opcode, &opcodeEntry),
return false);
-#define CASE(OpCode) \
- case OpCode: \
- return isValid<OpCode>(inst, opcodeEntry);
+#define CASE(OpCode) \
+ case Spv##OpCode: \
+ return isValid<Spv##OpCode>(inst, opcodeEntry);
#define FAIL(OpCode) \
- case OpCode: \
+ case Spv##OpCode: \
std::cerr << "Not implemented: " << #OpCode << "\n"; \
return false;
switch (inst->opcode) {
INSTANTIATE_TEST_CASE_P(InvalidIds, BinaryToTextFail,
::testing::ValuesIn(std::vector<FailedDecodeCase>{
{"%1 = OpTypeVoid",
- spvtest::MakeInstruction(spv::OpTypeVoid, {1}),
+ spvtest::MakeInstruction(SpvOpTypeVoid, {1}),
"Id 1 is defined more than once"},
{"%1 = OpTypeVoid\n"
"%2 = OpNot %1 %foo",
- spvtest::MakeInstruction(spv::OpNot, {1, 2, 3}),
+ spvtest::MakeInstruction(SpvOpNot, {1, 2, 3}),
"Id 2 is defined more than once"},
{"%1 = OpTypeVoid\n"
"%2 = OpNot %1 %foo",
- spvtest::MakeInstruction(spv::OpNot, {1, 1, 3}),
+ spvtest::MakeInstruction(SpvOpNot, {1, 1, 3}),
"Id 1 is defined more than once"},
}));
EXPECT_THAT(
CompiledInstructions(input),
Eq(Concatenate(
- {MakeInstruction(spv::OpExtInstImport, {1}, MakeVector("OpenCL.std")),
- MakeInstruction(spv::OpExtInst, {2, 3, 1, GetParam().opcode},
+ {MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("OpenCL.std")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, GetParam().opcode},
GetParam().expected_operands)})))
<< input;
// Now check the round trip through the disassembler.
#define CASE3Round(Enum, Name, Mode) \
{ \
uint32_t(OpenCLLIB::Entrypoints::Enum), #Name, "%4 %5 %6 " #Mode, { \
- 4, 5, 6, uint32_t(spv::FPRoundingMode##Mode) \
+ 4, 5, 6, uint32_t(SpvFPRoundingMode##Mode) \
} \
}
EXPECT_THAT(
CompiledInstructions(input),
Eq(Concatenate({
- MakeInstruction(spv::OpExtInstImport, {1}, MakeVector("OpenCL.std")),
- MakeInstruction(spv::OpExtInstImport, {2},
+ MakeInstruction(SpvOpExtInstImport, {1}, MakeVector("OpenCL.std")),
+ MakeInstruction(SpvOpExtInstImport, {2},
MakeVector("GLSL.std.450")),
MakeInstruction(
- spv::OpExtInst,
+ SpvOpExtInst,
{3, 4, 1, uint32_t(OpenCLLIB::Entrypoints::Native_sqrt), 5}),
- MakeInstruction(spv::OpExtInst,
+ MakeInstruction(SpvOpExtInst,
{6, 7, 2, uint32_t(GLSLstd450MatrixInverse), 8}),
})));
}
TEST_F(ImmediateIntTest, AnyWordInSimpleStatement) {
EXPECT_THAT(CompiledInstructions("!0x00040018 %a %b %123", kCAF),
- Eq(MakeInstruction(spv::OpTypeMatrix, {1, 2, 3})));
+ Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 3})));
EXPECT_THAT(CompiledInstructions("OpTypeMatrix !1 %b %123", kCAF),
- Eq(MakeInstruction(spv::OpTypeMatrix, {1, 1, 2})));
+ Eq(MakeInstruction(SpvOpTypeMatrix, {1, 1, 2})));
EXPECT_THAT(CompiledInstructions("OpTypeMatrix %1 !2 %123", kCAF),
- Eq(MakeInstruction(spv::OpTypeMatrix, {1, 2, 2})));
+ Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 2})));
EXPECT_THAT(CompiledInstructions("OpTypeMatrix %a %b !123", kCAF),
- Eq(MakeInstruction(spv::OpTypeMatrix, {1, 2, 123})));
+ Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 123})));
EXPECT_THAT(CompiledInstructions("!0x00040018 %1 !2 %123", kCAF),
- Eq(MakeInstruction(spv::OpTypeMatrix, {1, 2, 2})));
+ Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 2})));
EXPECT_THAT(CompiledInstructions("OpTypeMatrix !1 %b !123", kCAF),
- Eq(MakeInstruction(spv::OpTypeMatrix, {1, 1, 123})));
+ Eq(MakeInstruction(SpvOpTypeMatrix, {1, 1, 123})));
EXPECT_THAT(CompiledInstructions("!0x00040018 !1 !2 !123", kCAF),
- Eq(MakeInstruction(spv::OpTypeMatrix, {1, 2, 123})));
+ Eq(MakeInstruction(SpvOpTypeMatrix, {1, 2, 123})));
}
TEST_F(ImmediateIntTest, AnyWordAfterEqualsAndOpCode) {
EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 %c 123"),
- Eq(MakeInstruction(spv::OpArrayLength, {2, 1, 2, 123})));
+ Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 2, 123})));
EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b !3 123"),
- Eq(MakeInstruction(spv::OpArrayLength, {1, 2, 3, 123})));
+ Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123})));
EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b %c !123"),
- Eq(MakeInstruction(spv::OpArrayLength, {1, 2, 3, 123})));
+ Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123})));
EXPECT_THAT(CompiledInstructions("%a = OpArrayLength %b !3 !123"),
- Eq(MakeInstruction(spv::OpArrayLength, {1, 2, 3, 123})));
+ Eq(MakeInstruction(SpvOpArrayLength, {1, 2, 3, 123})));
EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 !3 123"),
- Eq(MakeInstruction(spv::OpArrayLength, {2, 1, 3, 123})));
+ Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 3, 123})));
EXPECT_THAT(CompiledInstructions("%a = OpArrayLength !2 !3 !123"),
- Eq(MakeInstruction(spv::OpArrayLength, {2, 1, 3, 123})));
+ Eq(MakeInstruction(SpvOpArrayLength, {2, 1, 3, 123})));
}
TEST_F(ImmediateIntTest, ResultIdInAssignment) {
// With !<integer>, we can (and can only) accept 32-bit number literals,
// even when we declare the return type is 64-bit.
EXPECT_EQ(Concatenate({
- MakeInstruction(OpTypeInt, {1, 64, 0}),
- MakeInstruction(OpConstant, {1, 2, 4294967295}),
+ MakeInstruction(SpvOpTypeInt, {1, 64, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 4294967295}),
}),
CompiledInstructions("OpTypeInt %i64 64 0\n"
"OpConstant %i64 !2 4294967295",
CompiledInstructions("OpTypeFloat %1 32\nOpConstant %1 %2 -0.5", kCAF),
CompiledInstructions("OpTypeFloat %1 32\n!0x0004002b %1 %2 -0.5", kCAF));
- EXPECT_EQ(
- Concatenate({
- MakeInstruction(OpTypeInt, {1, 64, 0}),
- MakeInstruction(OpConstant, {1, 2, 0xb, 0xa}),
- MakeInstruction(OpSwitch, {2, 1234, BitwiseCast<uint32_t>(2.5f), 3}),
- }),
- CompiledInstructions("%i64 = OpTypeInt 64 0\n"
- "%big = OpConstant %i64 0xa0000000b\n"
- "OpSwitch %big !1234 2.5 %target\n"));
+ EXPECT_EQ(Concatenate({
+ MakeInstruction(SpvOpTypeInt, {1, 64, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0xb, 0xa}),
+ MakeInstruction(SpvOpSwitch,
+ {2, 1234, BitwiseCast<uint32_t>(2.5f), 3}),
+ }),
+ CompiledInstructions("%i64 = OpTypeInt 64 0\n"
+ "%big = OpConstant %i64 0xa0000000b\n"
+ "OpSwitch %big !1234 2.5 %target\n"));
}
// Literal strings after !<integer> are handled correctly.
CompiledInstructions("OpMemberName !1 !4 \"" + name + "\"", kCAF))
<< name;
const uint32_t wordCount = 4 + name.size() / 4;
- const uint32_t firstWord = spvOpcodeMake(wordCount, spv::OpMemberName);
+ const uint32_t firstWord = spvOpcodeMake(wordCount, SpvOpMemberName);
EXPECT_EQ(original, CompiledInstructions("!" + std::to_string(firstWord) +
" %10 !4 \"" + name + "\"",
kCAF))
EXPECT_THAT(Subvector(CompileSuccessfully(
"OpTypeFloat %10 32 !5 !6 !7 OpEmitVertex", kCAF),
kFirstInstruction),
- ElementsAre(spvOpcodeMake(3, spv::OpTypeFloat), 1, 32, 5, 6, 7,
- spvOpcodeMake(1, spv::OpEmitVertex)));
+ ElementsAre(spvOpcodeMake(3, SpvOpTypeFloat), 1, 32, 5, 6, 7,
+ spvOpcodeMake(1, SpvOpEmitVertex)));
}
TEST_F(ImmediateIntTest, NextOpcodeRecognized) {
uint32_t word = 0;
word |= uint32_t(opcode);
word |= uint32_t(wordCount) << 16;
- EXPECT_EQ(word, spvOpcodeMake(wordCount, Op(opcode)));
+ EXPECT_EQ(word, spvOpcodeMake(wordCount, SpvOp(opcode)));
}
}
}
namespace {
-class Requires : public ::testing::TestWithParam<Capability> {
+class Requires : public ::testing::TestWithParam<SpvCapability> {
public:
Requires()
: entry({nullptr,
- (Op)0,
+ (SpvOp)0,
SPV_CAPABILITY_AS_MASK(GetParam()),
0,
{},
ASSERT_NE(0, spvOpcodeRequiresCapabilities(&entry));
}
-INSTANTIATE_TEST_CASE_P(Op, Requires,
- ::testing::Values(CapabilityMatrix, CapabilityShader,
- CapabilityGeometry,
- CapabilityTessellation,
- CapabilityAddresses,
- CapabilityLinkage, CapabilityKernel,
- // ClipDistance has enum value 32.
- // So it tests that we are sensitive
- // to more than just the least
- // significant 32 bits of the
- // capability mask.
- CapabilityClipDistance,
- // Transformfeedback has value 53,
- // and is the last capability.
- CapabilityTransformFeedback));
+INSTANTIATE_TEST_CASE_P(
+ Op, Requires,
+ ::testing::Values(SpvCapabilityMatrix, SpvCapabilityShader,
+ SpvCapabilityGeometry, SpvCapabilityTessellation,
+ SpvCapabilityAddresses, SpvCapabilityLinkage,
+ SpvCapabilityKernel,
+ // ClipDistance has enum value 32.
+ // So it tests that we are sensitive
+ // to more than just the least
+ // significant 32 bits of the
+ // capability mask.
+ SpvCapabilityClipDistance,
+ // Transformfeedback has value 53,
+ // and is the last capability.
+ SpvCapabilityTransformFeedback));
TEST(OpcodeRequiresCapability, None) {
- spv_opcode_desc_t entry = {
- nullptr, (Op)0, 0, 0, {}, false, false, {}};
+ spv_opcode_desc_t entry = {nullptr, (SpvOp)0, 0, 0, {}, false, false, {}};
ASSERT_EQ(0, spvOpcodeRequiresCapabilities(&entry));
}
/// Test SPV_CAPBILITY_AS_MASK
TEST(CapabilityAsMaskMacro, Sample) {
- EXPECT_EQ(uint64_t(1), SPV_CAPABILITY_AS_MASK(spv::CapabilityMatrix));
- EXPECT_EQ(uint64_t(0x10000), SPV_CAPABILITY_AS_MASK(spv::CapabilityImageSRGBWrite));
- EXPECT_EQ(uint64_t(0x100000000ULL), SPV_CAPABILITY_AS_MASK(spv::CapabilityClipDistance));
- EXPECT_EQ(uint64_t(1) << 53, SPV_CAPABILITY_AS_MASK(spv::CapabilityTransformFeedback));
+ EXPECT_EQ(uint64_t(1), SPV_CAPABILITY_AS_MASK(SpvCapabilityMatrix));
+ EXPECT_EQ(uint64_t(0x10000),
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityImageSRGBWrite));
+ EXPECT_EQ(uint64_t(0x100000000ULL),
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityClipDistance));
+ EXPECT_EQ(uint64_t(1) << 53,
+ SPV_CAPABILITY_AS_MASK(SpvCapabilityTransformFeedback));
};
/// Capabilities required by an Opcode.
struct ExpectedOpCodeCapabilities {
- spv::Op opcode;
- uint64_t capabilities; //< Bitfield of spv::Capability.
+ SpvOp opcode;
+ uint64_t capabilities; //< Bitfield of SpvCapability.
};
using OpcodeTableCapabilitiesTest =
EXPECT_EQ(GetParam().capabilities, entry->capabilities);
}
-/// Translates a spv::Capability into a bitfield.
-inline uint64_t mask(spv::Capability c) { return SPV_CAPABILITY_AS_MASK(c); }
+/// Translates a SpvCapability into a bitfield.
+inline uint64_t mask(SpvCapability c) { return SPV_CAPABILITY_AS_MASK(c); }
-/// Combines two spv::Capabilities into a bitfield.
-inline uint64_t mask(spv::Capability c1, spv::Capability c2) {
+/// Combines two SpvCapabilities into a bitfield.
+inline uint64_t mask(SpvCapability c1, SpvCapability c2) {
return SPV_CAPABILITY_AS_MASK(c1) | SPV_CAPABILITY_AS_MASK(c2);
}
// Spot-check a few opcodes.
::testing::Values(
ExpectedOpCodeCapabilities{
- spv::OpImageQuerySize,
- mask(spv::CapabilityKernel, spv::CapabilityImageQuery)},
+ SpvOpImageQuerySize,
+ mask(SpvCapabilityKernel, SpvCapabilityImageQuery)},
ExpectedOpCodeCapabilities{
- spv::OpImageQuerySizeLod,
- mask(spv::CapabilityKernel, spv::CapabilityImageQuery)},
+ SpvOpImageQuerySizeLod,
+ mask(SpvCapabilityKernel, SpvCapabilityImageQuery)},
ExpectedOpCodeCapabilities{
- spv::OpImageQueryLevels,
- mask(spv::CapabilityKernel, spv::CapabilityImageQuery)},
+ SpvOpImageQueryLevels,
+ mask(SpvCapabilityKernel, SpvCapabilityImageQuery)},
ExpectedOpCodeCapabilities{
- spv::OpImageQuerySamples,
- mask(spv::CapabilityKernel, spv::CapabilityImageQuery)},
- ExpectedOpCodeCapabilities{spv::OpImageSparseSampleImplicitLod,
- mask(spv::CapabilitySparseResidency)},
- ExpectedOpCodeCapabilities{spv::OpCopyMemorySized,
- mask(spv::CapabilityAddresses)},
- ExpectedOpCodeCapabilities{spv::OpArrayLength,
- mask(spv::CapabilityShader)},
- ExpectedOpCodeCapabilities{spv::OpFunction, 0},
- ExpectedOpCodeCapabilities{spv::OpConvertFToS, 0}));
+ SpvOpImageQuerySamples,
+ mask(SpvCapabilityKernel, SpvCapabilityImageQuery)},
+ ExpectedOpCodeCapabilities{SpvOpImageSparseSampleImplicitLod,
+ mask(SpvCapabilitySparseResidency)},
+ ExpectedOpCodeCapabilities{SpvOpCopyMemorySized,
+ mask(SpvCapabilityAddresses)},
+ ExpectedOpCodeCapabilities{SpvOpArrayLength, mask(SpvCapabilityShader)},
+ ExpectedOpCodeCapabilities{SpvOpFunction, 0},
+ ExpectedOpCodeCapabilities{SpvOpConvertFToS, 0}));
} // anonymous namespace
namespace {
TEST(OpcodeSplit, Default) {
- uint32_t word = spvOpcodeMake(42, (Op)23);
+ uint32_t word = spvOpcodeMake(42, (SpvOp)23);
uint16_t wordCount = 0;
- Op opcode;
+ SpvOp opcode;
spvOpcodeSplit(word, &wordCount, &opcode);
ASSERT_EQ(42, wordCount);
ASSERT_EQ(23, opcode);
}
#define CASE0(TYPE, VALUE) \
- { SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), 0 }
-#define CASE1(TYPE, VALUE, CAP) \
- { \
- SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), \
- SPV_CAPABILITY_AS_MASK(spv::Capability##CAP) \
+ { SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), 0 }
+#define CASE1(TYPE, VALUE, CAP) \
+ { \
+ SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), \
+ SPV_CAPABILITY_AS_MASK(SpvCapability##CAP) \
}
-#define CASE2(TYPE, VALUE, CAP1, CAP2) \
- { \
- SPV_OPERAND_TYPE_##TYPE, uint32_t(spv::VALUE), \
- (SPV_CAPABILITY_AS_MASK(spv::Capability##CAP1) | \
- SPV_CAPABILITY_AS_MASK(spv::Capability##CAP2)) \
+#define CASE2(TYPE, VALUE, CAP1, CAP2) \
+ { \
+ SPV_OPERAND_TYPE_##TYPE, uint32_t(Spv##VALUE), \
+ (SPV_CAPABILITY_AS_MASK(SpvCapability##CAP1) | \
+ SPV_CAPABILITY_AS_MASK(SpvCapability##CAP2)) \
}
// See SPIR-V Section 3.3 Execution Model
{SUFFIX1}},
// Volatile has no operands.
{SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS,
- spv::MemoryAccessVolatileMask,
+ SpvMemoryAccessVolatileMask,
{SUFFIX0},
{SUFFIX0}},
// Aligned has one literal number operand.
{SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS,
- spv::MemoryAccessAlignedMask,
+ SpvMemoryAccessAlignedMask,
{SUFFIX1},
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SUFFIX1}},
// Volatile with Aligned still has just one literal number operand.
{SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS,
- spv::MemoryAccessVolatileMask | spv::MemoryAccessAlignedMask,
+ SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask,
{SUFFIX1},
{SPV_OPERAND_TYPE_LITERAL_INTEGER, SUFFIX1}},
}));
// Test OpDecorate
using OpDecorateSimpleTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::Decoration>>>;
+ ::testing::TestWithParam<EnumCase<SpvDecoration>>>;
TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) {
// This string should assemble, but should not validate.
for (auto operand : GetParam().operands()) input << " " << operand;
EXPECT_THAT(
CompiledInstructions(input.str()),
- Eq(MakeInstruction(spv::OpDecorate, {1, uint32_t(GetParam().value())},
+ Eq(MakeInstruction(SpvOpDecorate, {1, uint32_t(GetParam().value())},
GetParam().operands())));
}
-#define CASE(NAME) spv::Decoration##NAME, #NAME
+#define CASE(NAME) SpvDecoration##NAME, #NAME
INSTANTIATE_TEST_CASE_P(
TextToBinaryDecorateSimple, OpDecorateSimpleTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::Decoration>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvDecoration>>{
// The operand literal values are arbitrarily chosen,
// but there are the right number of them.
{CASE(RelaxedPrecision), {}},
const std::string input =
"OpDecorate %1 " + GetParam().enum_name + " " + GetParam().name;
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpDecorate, {1, GetParam().enum_value,
+ Eq(MakeInstruction(SpvOpDecorate, {1, GetParam().enum_value,
GetParam().value})));
}
// Test OpDecorate BuiltIn.
// clang-format off
#define CASE(NAME) \
- { spv::BuiltIn##NAME, #NAME, spv::DecorationBuiltIn, "BuiltIn" }
+ { SpvBuiltIn##NAME, #NAME, SpvDecorationBuiltIn, "BuiltIn" }
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
::testing::ValuesIn(std::vector<DecorateEnumCase>{
CASE(Position),
// Test OpDecorate FuncParamAttr
// clang-format off
#define CASE(NAME) \
- { spv::FunctionParameterAttribute##NAME, #NAME, spv::DecorationFuncParamAttr, "FuncParamAttr" }
+ { SpvFunctionParameterAttribute##NAME, #NAME, SpvDecorationFuncParamAttr, "FuncParamAttr" }
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
::testing::ValuesIn(std::vector<DecorateEnumCase>{
CASE(Zext),
// Test OpDecorate FPRoundingMode
// clang-format off
#define CASE(NAME) \
- { spv::FPRoundingMode##NAME, #NAME, spv::DecorationFPRoundingMode, "FPRoundingMode" }
+ { SpvFPRoundingMode##NAME, #NAME, SpvDecorationFPRoundingMode, "FPRoundingMode" }
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest,
::testing::ValuesIn(std::vector<DecorateEnumCase>{
CASE(RTE),
// clang-format off
#define CASE(ENUM,NAME) \
- { spv::FPFastMathMode##ENUM, #NAME, spv::DecorationFPFastMathMode, "FPFastMathMode" }
+ { SpvFPFastMathMode##ENUM, #NAME, SpvDecorationFPFastMathMode, "FPFastMathMode" }
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
::testing::ValuesIn(std::vector<DecorateEnumCase>{
CASE(MaskNone, None),
// Sample a single combination. This ensures we've integrated
// the instruction parsing logic with spvTextParseMask.
const std::string input = "OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ";
- const uint32_t expected_enum = spv::DecorationFPFastMathMode;
- const uint32_t expected_mask = spv::FPFastMathModeNotNaNMask |
- spv::FPFastMathModeNotInfMask |
- spv::FPFastMathModeNSZMask;
+ const uint32_t expected_enum = SpvDecorationFPFastMathMode;
+ const uint32_t expected_mask = SpvFPFastMathModeNotNaNMask |
+ SpvFPFastMathModeNotInfMask |
+ SpvFPFastMathModeNSZMask;
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpDecorate, {1, expected_enum, expected_mask})));
+ Eq(MakeInstruction(SpvOpDecorate, {1, expected_enum, expected_mask})));
}
TEST_F(OpDecorateEnumTest, WrongFPFastMathMode) {
const std::string input = "OpDecorate %1 LinkageAttributes \"" +
GetParam().external_name + "\" " +
GetParam().linkage_type_name;
- std::vector<uint32_t> expected_operands{1, spv::DecorationLinkageAttributes};
+ std::vector<uint32_t> expected_operands{1, SpvDecorationLinkageAttributes};
std::vector<uint32_t> encoded_external_name =
MakeVector(GetParam().external_name);
expected_operands.insert(expected_operands.end(),
encoded_external_name.end());
expected_operands.push_back(GetParam().linkage_type_value);
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpDecorate, expected_operands)));
+ Eq(MakeInstruction(SpvOpDecorate, expected_operands)));
}
// clang-format off
-#define CASE(ENUM) spv::LinkageType##ENUM, #ENUM
+#define CASE(ENUM) SpvLinkageType##ENUM, #ENUM
INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest,
::testing::ValuesIn(std::vector<DecorateLinkageCase>{
{ CASE(Import), "a" },
TEST_F(TextToBinaryTest, GroupMemberDecorateGoodOneTarget) {
EXPECT_THAT(CompiledInstructions("OpGroupMemberDecorate %group %id0 42"),
- Eq(MakeInstruction(spv::OpGroupMemberDecorate, {1, 2, 42})));
+ Eq(MakeInstruction(SpvOpGroupMemberDecorate, {1, 2, 42})));
}
TEST_F(TextToBinaryTest, GroupMemberDecorateGoodTwoTargets) {
EXPECT_THAT(
CompiledInstructions("OpGroupMemberDecorate %group %id0 96 %id1 42"),
- Eq(MakeInstruction(spv::OpGroupMemberDecorate, {1, 2, 96, 3, 42})));
+ Eq(MakeInstruction(SpvOpGroupMemberDecorate, {1, 2, 96, 3, 42})));
}
TEST_F(TextToBinaryTest, GroupMemberDecorateMissingGroupId) {
TEST_F(OpMemoryBarrier, Good) {
const std::string input = "OpMemoryBarrier %1 %2\n";
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpMemoryBarrier, {1, 2})));
+ Eq(MakeInstruction(SpvOpMemoryBarrier, {1, 2})));
EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input));
}
// Test Sampler Addressing Mode enum values
using SamplerAddressingModeTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::SamplerAddressingMode>>>;
+ ::testing::TestWithParam<EnumCase<SpvSamplerAddressingMode>>>;
TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) {
const std::string input =
"%result = OpConstantSampler %type " + GetParam().name() + " 0 Nearest";
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpConstantSampler,
+ Eq(MakeInstruction(SpvOpConstantSampler,
{1, 2, GetParam().value(), 0, 0})));
}
// clang-format off
-#define CASE(NAME) { spv::SamplerAddressingMode##NAME, #NAME }
+#define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME }
INSTANTIATE_TEST_CASE_P(
TextToBinarySamplerAddressingMode, SamplerAddressingModeTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::SamplerAddressingMode>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvSamplerAddressingMode>>{
CASE(None),
CASE(ClampToEdge),
CASE(Clamp),
// Test Sampler Filter Mode enum values
using SamplerFilterModeTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::SamplerFilterMode>>>;
+ ::testing::TestWithParam<EnumCase<SpvSamplerFilterMode>>>;
TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) {
const std::string input =
"%result = OpConstantSampler %type Clamp 0 " + GetParam().name();
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpConstantSampler,
+ Eq(MakeInstruction(SpvOpConstantSampler,
{1, 2, 2, 0, GetParam().value()})));
}
// clang-format off
-#define CASE(NAME) { spv::SamplerFilterMode##NAME, #NAME}
+#define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME}
INSTANTIATE_TEST_CASE_P(
TextToBinarySamplerFilterMode, SamplerFilterModeTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::SamplerFilterMode>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvSamplerFilterMode>>{
CASE(Nearest),
CASE(Linear),
}));
::testing::ValuesIn(std::vector<ConstantTestCase>{
// Check 16 bits
{"OpTypeInt 16 0", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 0x1234})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0x1234})})},
{"OpTypeInt 16 0", "0x8000",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 0x8000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0x8000})})},
{"OpTypeInt 16 1", "0x8000", // Test sign extension.
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 1}),
- MakeInstruction(spv::OpConstant, {1, 2, 0xffff8000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0xffff8000})})},
{"OpTypeInt 16 1", "-32",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 1}),
- MakeInstruction(spv::OpConstant, {1, 2, uint32_t(-32)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}),
+ MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})},
// Check 32 bits
{"OpTypeInt 32 0", "42",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 32, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 42})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 42})})},
{"OpTypeInt 32 1", "-32",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 32, 1}),
- MakeInstruction(spv::OpConstant, {1, 2, uint32_t(-32)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}),
+ MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32)})})},
{"OpTypeFloat 32", "1.0",
- Concatenate({MakeInstruction(spv::OpTypeFloat, {1, 32}),
- MakeInstruction(spv::OpConstant, {1, 2, 0x3f800000})})},
+ Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0x3f800000})})},
{"OpTypeFloat 32", "10.0",
- Concatenate({MakeInstruction(spv::OpTypeFloat, {1, 32}),
- MakeInstruction(spv::OpConstant, {1, 2, 0x41200000})})},
+ Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0x41200000})})},
// Check 48 bits
{"OpTypeInt 48 0", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 0x1234, 0})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})},
{"OpTypeInt 48 0", "0x800000000001",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 1, 0x00008000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 1, 0x00008000})})},
{"OpTypeInt 48 1", "0x800000000000", // Test sign extension.
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 1}),
- MakeInstruction(spv::OpConstant, {1, 2, 0, 0xffff8000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0, 0xffff8000})})},
{"OpTypeInt 48 1", "-32",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 1}),
- MakeInstruction(spv::OpConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}),
+ MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})},
// Check 64 bits
{"OpTypeInt 64 0", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 64, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 0x1234, 0})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})},
{"OpTypeInt 64 1", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 64, 1}),
- MakeInstruction(spv::OpConstant, {1, 2, 0x1234, 0})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
+ MakeInstruction(SpvOpConstant, {1, 2, 0x1234, 0})})},
{"OpTypeInt 64 1", "-42",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 64, 1}),
- MakeInstruction(spv::OpConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
+ MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
}));
// clang-format on
::testing::ValuesIn(std::vector<ConstantTestCase>{
// Check 16 bits
{"OpTypeInt 16 0", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 0}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0x1234})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234})})},
{"OpTypeInt 16 0", "0x8000",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 0}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0x8000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 0}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0x8000})})},
{"OpTypeInt 16 1", "0x8000", // Test sign extension.
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 1}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0xffff8000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0xffff8000})})},
{"OpTypeInt 16 1", "-32",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 16, 1}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, uint32_t(-32)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})},
// Check 32 bits
{"OpTypeInt 32 0", "42",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 32, 0}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 42})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 42})})},
{"OpTypeInt 32 1", "-32",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 32, 1}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, uint32_t(-32)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 1}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32)})})},
{"OpTypeFloat 32", "1.0",
- Concatenate({MakeInstruction(spv::OpTypeFloat, {1, 32}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0x3f800000})})},
+ Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0x3f800000})})},
{"OpTypeFloat 32", "10.0",
- Concatenate({MakeInstruction(spv::OpTypeFloat, {1, 32}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0x41200000})})},
+ Concatenate({MakeInstruction(SpvOpTypeFloat, {1, 32}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0x41200000})})},
// Check 48 bits
{"OpTypeInt 48 0", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 0}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0x1234, 0})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})},
{"OpTypeInt 48 0", "0x800000000001",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 0}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 1, 0x00008000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 0}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 1, 0x00008000})})},
{"OpTypeInt 48 1", "0x800000000000", // Test sign extension.
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 1}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0, 0xffff8000})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0, 0xffff8000})})},
{"OpTypeInt 48 1", "-32",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 48, 1}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 48, 1}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-32), uint32_t(-1)})})},
// Check 64 bits
{"OpTypeInt 64 0", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 64, 0}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0x1234, 0})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 0}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})},
{"OpTypeInt 64 1", "0x1234",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 64, 1}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, 0x1234, 0})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, 0x1234, 0})})},
{"OpTypeInt 64 1", "-42",
- Concatenate({MakeInstruction(spv::OpTypeInt, {1, 64, 1}),
- MakeInstruction(spv::OpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
+ Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
+ MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
}));
// clang-format on
// Test OpSelectionMerge
using OpSelectionMergeTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::SelectionControlMask>>>;
+ ::testing::TestWithParam<EnumCase<SpvSelectionControlMask>>>;
TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) {
const std::string input = "OpSelectionMerge %1 " + GetParam().name();
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpSelectionMerge, {1, GetParam().value()})));
+ Eq(MakeInstruction(SpvOpSelectionMerge, {1, GetParam().value()})));
}
// clang-format off
-#define CASE(VALUE,NAME) { spv::SelectionControl##VALUE, NAME}
+#define CASE(VALUE,NAME) { SpvSelectionControl##VALUE, NAME}
INSTANTIATE_TEST_CASE_P(TextToBinarySelectionMerge, OpSelectionMergeTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::SelectionControlMask>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvSelectionControlMask>>{
CASE(MaskNone, "None"),
CASE(FlattenMask, "Flatten"),
CASE(DontFlattenMask, "DontFlatten"),
TEST_F(OpSelectionMergeTest, CombinedSelectionControlMask) {
const std::string input = "OpSelectionMerge %1 Flatten|DontFlatten";
const uint32_t expected_mask =
- spv::SelectionControlFlattenMask | spv::SelectionControlDontFlattenMask;
+ SpvSelectionControlFlattenMask | SpvSelectionControlDontFlattenMask;
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpSelectionMerge, {1, expected_mask})));
+ Eq(MakeInstruction(SpvOpSelectionMerge, {1, expected_mask})));
}
TEST_F(OpSelectionMergeTest, WrongSelectionControl) {
// Test OpLoopMerge
using OpLoopMergeTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::LoopControlMask>>>;
+ ::testing::TestWithParam<EnumCase<SpvLoopControlMask>>>;
TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) {
const std::string input = "OpLoopMerge %merge %continue " + GetParam().name();
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpLoopMerge, {1, 2, GetParam().value()})));
+ Eq(MakeInstruction(SpvOpLoopMerge, {1, 2, GetParam().value()})));
}
// clang-format off
-#define CASE(VALUE,NAME) { spv::LoopControl##VALUE, NAME}
+#define CASE(VALUE,NAME) { SpvLoopControl##VALUE, NAME}
INSTANTIATE_TEST_CASE_P(TextToBinaryLoopMerge, OpLoopMergeTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::LoopControlMask>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvLoopControlMask>>{
CASE(MaskNone, "None"),
CASE(UnrollMask, "Unroll"),
CASE(DontUnrollMask, "DontUnroll"),
TEST_F(OpLoopMergeTest, CombinedLoopControlMask) {
const std::string input = "OpLoopMerge %merge %continue Unroll|DontUnroll";
const uint32_t expected_mask =
- spv::LoopControlUnrollMask | spv::LoopControlDontUnrollMask;
+ SpvLoopControlUnrollMask | SpvLoopControlDontUnrollMask;
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpLoopMerge, {1, 2, expected_mask})));
+ Eq(MakeInstruction(SpvOpLoopMerge, {1, 2, expected_mask})));
}
TEST_F(OpLoopMergeTest, WrongLoopControl) {
TEST_F(TextToBinaryTest, SwitchGoodZeroTargets) {
EXPECT_THAT(CompiledInstructions("OpSwitch %selector %default"),
- Eq(MakeInstruction(spv::OpSwitch, {1, 2})));
+ Eq(MakeInstruction(SpvOpSwitch, {1, 2})));
}
TEST_F(TextToBinaryTest, SwitchGoodOneTarget) {
EXPECT_THAT(CompiledInstructions("%1 = OpTypeInt 32 0\n"
"%2 = OpConstant %1 52\n"
"OpSwitch %2 %default 12 %target0"),
- Eq(Concatenate({MakeInstruction(spv::OpTypeInt, {1, 32, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 52}),
- MakeInstruction(spv::OpSwitch, {2, 3, 12, 4})})));
+ Eq(Concatenate({MakeInstruction(SpvOpTypeInt, {1, 32, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 52}),
+ MakeInstruction(SpvOpSwitch, {2, 3, 12, 4})})));
}
TEST_F(TextToBinaryTest, SwitchGoodTwoTargets) {
"%2 = OpConstant %1 52\n"
"OpSwitch %2 %default 12 %target0 42 %target1"),
Eq(Concatenate({
- MakeInstruction(spv::OpTypeInt, {1, 32, 0}),
- MakeInstruction(spv::OpConstant, {1, 2, 52}),
- MakeInstruction(spv::OpSwitch, {2, 3, 12, 4, 42, 5}),
+ MakeInstruction(SpvOpTypeInt, {1, 32, 0}),
+ MakeInstruction(SpvOpConstant, {1, 2, 52}),
+ MakeInstruction(SpvOpSwitch, {2, 3, 12, 4, 42, 5}),
})));
}
constant_str,
case_value_str,
{Concatenate(
- {MakeInstruction(spv::OpTypeInt,
+ {MakeInstruction(SpvOpTypeInt,
{1, integer_width, integer_signedness}),
- MakeInstruction(spv::OpConstant,
+ MakeInstruction(SpvOpConstant,
Concatenate({{1, 2}, encoded_constant})),
- MakeInstruction(spv::OpSwitch,
+ MakeInstruction(SpvOpSwitch,
Concatenate({{2, 3}, encoded_case_value, {4}}))})}};
}
return static_cast<uint32_t>(language_value);
}
const char* language_name;
- spv::SourceLanguage language_value;
+ SpvSourceLanguage language_value;
uint32_t version;
};
// The list of OpSource cases to use.
const LanguageCase kLanguageCases[] = {
#define CASE(NAME, VERSION) \
- { #NAME, spv::SourceLanguage##NAME, VERSION }
+ { #NAME, SpvSourceLanguage##NAME, VERSION }
CASE(Unknown, 0),
CASE(Unknown, 999),
CASE(ESSL, 310),
std::to_string(GetParam().version);
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpSource, {GetParam().get_language_value(),
+ Eq(MakeInstruction(SpvOpSource, {GetParam().get_language_value(),
GetParam().version})));
}
const std::string input = "OpSource GLSL 450 %file_id";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpSource, {spv::SourceLanguageGLSL, 450, 1})));
+ Eq(MakeInstruction(SpvOpSource, {SpvSourceLanguageGLSL, 450, 1})));
};
TEST_F(TextToBinaryTest, OpSourceAcceptsOptionalSourceText) {
"OpSource GLSL 450 %file_id \"" + fake_source + "\"";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpSource, {spv::SourceLanguageGLSL, 450, 1},
+ Eq(MakeInstruction(SpvOpSource, {SpvSourceLanguageGLSL, 450, 1},
MakeVector(fake_source))));
};
std::string("OpSourceContinued \"") + GetParam() + "\"";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpSourceContinued, MakeVector(GetParam()))));
+ Eq(MakeInstruction(SpvOpSourceContinued, MakeVector(GetParam()))));
}
// TODO(dneto): utf-8, quoting, escaping
std::string("OpSourceExtension \"") + GetParam() + "\"";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpSourceExtension, MakeVector(GetParam()))));
+ Eq(MakeInstruction(SpvOpSourceExtension, MakeVector(GetParam()))));
}
// TODO(dneto): utf-8, quoting, escaping
TEST_F(TextToBinaryTest, OpLine) {
EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"),
- Eq(MakeInstruction(spv::OpLine, {1, 42, 99})));
+ Eq(MakeInstruction(SpvOpLine, {1, 42, 99})));
}
TEST_F(TextToBinaryTest, OpNoLine) {
EXPECT_THAT(CompiledInstructions("OpNoLine"),
- Eq(MakeInstruction(spv::OpNoLine, {})));
+ Eq(MakeInstruction(SpvOpNoLine, {})));
}
using OpStringTest =
const std::string input =
std::string("%result = OpString \"") + GetParam() + "\"";
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpString, {1}, MakeVector(GetParam()))));
+ Eq(MakeInstruction(SpvOpString, {1}, MakeVector(GetParam()))));
}
// TODO(dneto): utf-8, quoting, escaping
const std::string input =
std::string("OpName %target \"") + GetParam() + "\"";
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpName, {1}, MakeVector(GetParam()))));
+ Eq(MakeInstruction(SpvOpName, {1}, MakeVector(GetParam()))));
}
// TODO(dneto): utf-8, quoting, escaping
std::string("OpMemberName %type 42 \"") + GetParam() + "\"";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpMemberName, {1, 42}, MakeVector(GetParam()))));
+ Eq(MakeInstruction(SpvOpMemberName, {1, 42}, MakeVector(GetParam()))));
}
// TODO(dneto): utf-8, quoting, escaping
" %wait_events %ret_event %invoke %param %param_size %param_align " +
GetParam().local_size_source;
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpEnqueueKernel,
+ Eq(MakeInstruction(SpvOpEnqueueKernel,
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12},
GetParam().local_size_operands)));
}
// Test OpFunction
using OpFunctionControlTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::FunctionControlMask>>>;
+ ::testing::TestWithParam<EnumCase<SpvFunctionControlMask>>>;
TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) {
const std::string input = "%result_id = OpFunction %result_type " +
GetParam().name() + " %function_type ";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpFunction, {1, 2, GetParam().value(), 3})));
+ Eq(MakeInstruction(SpvOpFunction, {1, 2, GetParam().value(), 3})));
}
// clang-format off
-#define CASE(VALUE,NAME) { spv::FunctionControl##VALUE, NAME }
+#define CASE(VALUE,NAME) { SpvFunctionControl##VALUE, NAME }
INSTANTIATE_TEST_CASE_P(TextToBinaryFunctionTest, OpFunctionControlTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::FunctionControlMask>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvFunctionControlMask>>{
CASE(MaskNone, "None"),
CASE(InlineMask, "Inline"),
CASE(DontInlineMask, "DontInline"),
// the instruction parsing logic with spvTextParseMask.
const std::string input =
"%result_id = OpFunction %result_type Inline|Pure|Const %function_type";
- const uint32_t expected_mask = spv::FunctionControlInlineMask |
- spv::FunctionControlPureMask |
- spv::FunctionControlConstMask;
+ const uint32_t expected_mask = SpvFunctionControlInlineMask |
+ SpvFunctionControlPureMask |
+ SpvFunctionControlConstMask;
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpFunction, {1, 2, expected_mask, 3})));
+ Eq(MakeInstruction(SpvOpFunction, {1, 2, expected_mask, 3})));
}
TEST_F(OpFunctionControlTest, WrongFunctionControl) {
// Test GroupOperation enum
using GroupOperationTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::GroupOperation>>>;
+ ::testing::TestWithParam<EnumCase<SpvGroupOperation>>>;
TEST_P(GroupOperationTest, AnyGroupOperation) {
const std::string input =
"%result = OpGroupIAdd %type %scope " + GetParam().name() + " %x";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpGroupIAdd, {1, 2, 3, GetParam().value(), 4})));
+ Eq(MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, GetParam().value(), 4})));
}
// clang-format off
-#define CASE(NAME) { spv::GroupOperation##NAME, #NAME}
+#define CASE(NAME) { SpvGroupOperation##NAME, #NAME}
INSTANTIATE_TEST_CASE_P(TextToBinaryGroupOperation, GroupOperationTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::GroupOperation>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvGroupOperation>>{
CASE(Reduce),
CASE(InclusiveScan),
CASE(ExclusiveScan),
const std::string input =
"%result = OpImageFetch %type %image %coord " + GetParam().image_operands;
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpImageFetch, {1, 2, 3, 4},
+ Eq(MakeInstruction(SpvOpImageFetch, {1, 2, 3, 4},
GetParam().expected_mask_and_operands)));
}
-#define MASK(NAME) spv::ImageOperands##NAME##Mask
+#define MASK(NAME) SpvImageOperands##NAME##Mask
INSTANTIATE_TEST_CASE_P(
TextToBinaryImageOperandsAny, ImageOperandsTest,
::testing::ValuesIn(std::vector<ImageOperandsCase>{
{"MinLod %17", {MASK(MinLod), 5}},
}));
#undef MASK
-#define MASK(NAME) static_cast<uint32_t>(spv::ImageOperands##NAME##Mask)
+#define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
INSTANTIATE_TEST_CASE_P(
TextToBinaryImageOperandsCombination, ImageOperandsTest,
::testing::ValuesIn(std::vector<ImageOperandsCase>{
// Test assembly of Memory Access masks
using MemoryAccessTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::MemoryAccessMask>>>;
+ ::testing::TestWithParam<EnumCase<SpvMemoryAccessMask>>>;
TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) {
std::stringstream input;
input << "OpStore %ptr %value " << GetParam().name();
for (auto operand : GetParam().operands()) input << " " << operand;
EXPECT_THAT(CompiledInstructions(input.str()),
- Eq(MakeInstruction(spv::OpStore, {1, 2, GetParam().value()},
+ Eq(MakeInstruction(SpvOpStore, {1, 2, GetParam().value()},
GetParam().operands())));
}
INSTANTIATE_TEST_CASE_P(
TextToBinaryMemoryAccessTest, MemoryAccessTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::MemoryAccessMask>>{
- {spv::MemoryAccessMaskNone, "None", {}},
- {spv::MemoryAccessVolatileMask, "Volatile", {}},
- {spv::MemoryAccessAlignedMask, "Aligned", {16}},
- {spv::MemoryAccessNontemporalMask, "Nontemporal", {}},
+ ::testing::ValuesIn(std::vector<EnumCase<SpvMemoryAccessMask>>{
+ {SpvMemoryAccessMaskNone, "None", {}},
+ {SpvMemoryAccessVolatileMask, "Volatile", {}},
+ {SpvMemoryAccessAlignedMask, "Aligned", {16}},
+ {SpvMemoryAccessNontemporalMask, "Nontemporal", {}},
}));
TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) {
const std::string input = "OpStore %ptr %value Volatile|Aligned 16";
const uint32_t expected_mask =
- spv::MemoryAccessVolatileMask | spv::MemoryAccessAlignedMask;
+ SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask;
EXPECT_THAT(expected_mask, Eq(3));
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpStore, {1, 2, expected_mask, 16})));
+ Eq(MakeInstruction(SpvOpStore, {1, 2, expected_mask, 16})));
}
// Test Storage Class enum values
using StorageClassTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::StorageClass>>>;
+ ::testing::TestWithParam<EnumCase<SpvStorageClass>>>;
TEST_P(StorageClassTest, AnyStorageClass) {
const std::string input = "%1 = OpVariable %2 " + GetParam().name();
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpVariable, {1, 2, GetParam().value()})));
+ Eq(MakeInstruction(SpvOpVariable, {1, 2, GetParam().value()})));
}
// clang-format off
-#define CASE(NAME) { spv::StorageClass##NAME, #NAME, {} }
+#define CASE(NAME) { SpvStorageClass##NAME, #NAME, {} }
INSTANTIATE_TEST_CASE_P(
TextToBinaryStorageClassTest, StorageClassTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::StorageClass>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvStorageClass>>{
CASE(UniformConstant),
CASE(Input),
CASE(Uniform),
namespace {
using SpirvVector = spvtest::TextToBinaryTest::SpirvVector;
-using spv::Op;
using spvtest::MakeInstruction;
using ::testing::Eq;
using TextToBinaryMisc = spvtest::TextToBinaryTest;
TEST_F(TextToBinaryMisc, OpNop) {
- EXPECT_THAT(CompiledInstructions("OpNop"), Eq(MakeInstruction(OpNop, {})));
+ EXPECT_THAT(CompiledInstructions("OpNop"), Eq(MakeInstruction(SpvOpNop, {})));
}
TEST_F(TextToBinaryMisc, OpUndef) {
%u = OpUndef %f32)");
const uint32_t typeID = 1;
EXPECT_THAT(code[1], Eq(typeID));
- EXPECT_THAT(Subvector(code, 3), Eq(MakeInstruction(OpUndef, {typeID, 2})));
+ EXPECT_THAT(Subvector(code, 3), Eq(MakeInstruction(SpvOpUndef, {typeID, 2})));
}
} // anonymous namespace
uint32_t get_memory_value() const {
return static_cast<uint32_t>(memory_value);
}
- spv::AddressingModel addressing_value;
+ SpvAddressingModel addressing_value;
std::string addressing_name;
- spv::MemoryModel memory_value;
+ SpvMemoryModel memory_value;
std::string memory_name;
};
" " + GetParam().memory_name;
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpMemoryModel, {GetParam().get_addressing_value(),
+ Eq(MakeInstruction(SpvOpMemoryModel, {GetParam().get_addressing_value(),
GetParam().get_memory_value()})));
}
#define CASE(ADDRESSING, MEMORY) \
{ \
- spv::AddressingModel##ADDRESSING, #ADDRESSING, spv::MemoryModel##MEMORY, \
+ SpvAddressingModel##ADDRESSING, #ADDRESSING, SpvMemoryModel##MEMORY, \
#MEMORY \
}
// clang-format off
uint32_t get_execution_value() const {
return static_cast<uint32_t>(execution_value);
}
- spv::ExecutionModel execution_value;
+ SpvExecutionModel execution_value;
std::string execution_name;
std::string entry_point_name;
};
const std::string input = "OpEntryPoint " + GetParam().execution_name +
" %1 \"" + GetParam().entry_point_name + "\"";
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpEntryPoint,
+ Eq(MakeInstruction(SpvOpEntryPoint,
{GetParam().get_execution_value(), 1},
MakeVector(GetParam().entry_point_name))));
}
// clang-format off
-#define CASE(NAME) spv::ExecutionModel##NAME, #NAME
+#define CASE(NAME) SpvExecutionModel##NAME, #NAME
INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
::testing::ValuesIn(std::vector<EntryPointCase>{
{ CASE(Vertex), "" },
// Test OpExecutionMode
using OpExecutionModeTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::ExecutionMode>>>;
+ ::testing::TestWithParam<EnumCase<SpvExecutionMode>>>;
TEST_P(OpExecutionModeTest, AnyExecutionMode) {
// This string should assemble, but should not validate.
input << "OpExecutionMode %1 " << GetParam().name();
for (auto operand : GetParam().operands()) input << " " << operand;
EXPECT_THAT(CompiledInstructions(input.str()),
- Eq(MakeInstruction(spv::OpExecutionMode, {1, GetParam().value()},
+ Eq(MakeInstruction(SpvOpExecutionMode, {1, GetParam().value()},
GetParam().operands())));
}
-#define CASE(NAME) spv::ExecutionMode##NAME, #NAME
+#define CASE(NAME) SpvExecutionMode##NAME, #NAME
INSTANTIATE_TEST_CASE_P(
TextToBinaryExecutionMode, OpExecutionModeTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::ExecutionMode>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
// The operand literal values are arbitrarily chosen,
// but there are the right number of them.
{CASE(Invocations), {101}},
// Test OpCapability
using OpCapabilityTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::Capability>>>;
+ ::testing::TestWithParam<EnumCase<SpvCapability>>>;
TEST_P(OpCapabilityTest, AnyCapability) {
const std::string input = "OpCapability " + GetParam().name();
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpCapability, {GetParam().value()})));
+ Eq(MakeInstruction(SpvOpCapability, {GetParam().value()})));
}
// clang-format off
-#define CASE(NAME) { spv::Capability##NAME, #NAME }
+#define CASE(NAME) { SpvCapability##NAME, #NAME }
INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::Capability>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvCapability>>{
CASE(Matrix),
CASE(Shader),
CASE(Geometry),
// Test Dim enums via OpTypeImage
using DimTest =
- spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<spv::Dim>>>;
+ spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvDim>>>;
TEST_P(DimTest, AnyDim) {
const std::string input = "%imageType = OpTypeImage %sampledType " +
GetParam().name() + " 2 3 0 4 Rgba8";
EXPECT_THAT(
CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpTypeImage, {1, 2, GetParam().value(), 2, 3, 0,
- 4, spv::ImageFormatRgba8})));
+ Eq(MakeInstruction(SpvOpTypeImage, {1, 2, GetParam().value(), 2, 3, 0,
+ 4, SpvImageFormatRgba8})));
}
// clang-format off
-#define CASE(NAME) {spv::Dim##NAME, #NAME}
+#define CASE(NAME) {SpvDim##NAME, #NAME}
INSTANTIATE_TEST_CASE_P(
TextToBinaryDim, DimTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::Dim>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvDim>>{
CASE(1D),
CASE(2D),
CASE(3D),
// Test ImageFormat enums via OpTypeImage
using ImageFormatTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::ImageFormat>>>;
+ ::testing::TestWithParam<EnumCase<SpvImageFormat>>>;
TEST_P(ImageFormatTest, AnyImageFormat) {
const std::string input =
"%imageType = OpTypeImage %sampledType 1D 2 3 0 4 " + GetParam().name();
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpTypeImage, {1, 2, spv::Dim1D, 2, 3, 0,
+ Eq(MakeInstruction(SpvOpTypeImage, {1, 2, SpvDim1D, 2, 3, 0,
4, GetParam().value()})));
}
// clang-format off
-#define CASE(NAME) {spv::ImageFormat##NAME, #NAME}
+#define CASE(NAME) {SpvImageFormat##NAME, #NAME}
INSTANTIATE_TEST_CASE_P(
TextToBinaryImageFormat, ImageFormatTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::ImageFormat>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvImageFormat>>{
CASE(Unknown),
CASE(Rgba32f),
CASE(Rgba16f),
// Test AccessQualifier enums via OpTypePipe.
using OpTypePipeTest = spvtest::TextToBinaryTestBase<
- ::testing::TestWithParam<EnumCase<spv::AccessQualifier>>>;
+ ::testing::TestWithParam<EnumCase<SpvAccessQualifier>>>;
TEST_P(OpTypePipeTest, AnyAccessQualifier) {
const std::string input = "%1 = OpTypePipe " + GetParam().name();
EXPECT_THAT(CompiledInstructions(input),
- Eq(MakeInstruction(spv::OpTypePipe, {1, GetParam().value()})));
+ Eq(MakeInstruction(SpvOpTypePipe, {1, GetParam().value()})));
}
// clang-format off
-#define CASE(NAME) {spv::AccessQualifier##NAME, #NAME}
+#define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
INSTANTIATE_TEST_CASE_P(
TextToBinaryTypePipe, OpTypePipeTest,
- ::testing::ValuesIn(std::vector<EnumCase<spv::AccessQualifier>>{
+ ::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
CASE(ReadOnly),
CASE(WriteOnly),
CASE(ReadWrite),
do { \
EXPECT_THAT( \
CompiledInstructions("OpTypeForwardPointer %pt " #storage_class), \
- Eq(MakeInstruction(spv::OpTypeForwardPointer, \
- {1, StorageClass##storage_class}))); \
+ Eq(MakeInstruction(SpvOpTypeForwardPointer, \
+ {1, SpvStorageClass##storage_class}))); \
} while (0)
TEST_F(OpTypeForwardPointerTest, ValidStorageClass) {
uint64_t instIndex = SPV_INDEX_INSTRUCTION;
- ASSERT_EQ(spvOpcodeMake(3, OpSource), binary->code[instIndex++]);
- ASSERT_EQ(SourceLanguageOpenCL, binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(3, SpvOpSource), binary->code[instIndex++]);
+ ASSERT_EQ(SpvSourceLanguageOpenCL, binary->code[instIndex++]);
ASSERT_EQ(12, binary->code[instIndex++]);
- ASSERT_EQ(spvOpcodeMake(3, OpMemoryModel), binary->code[instIndex++]);
- ASSERT_EQ(AddressingModelPhysical64, binary->code[instIndex++]);
- ASSERT_EQ(MemoryModelOpenCL, binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(3, SpvOpMemoryModel), binary->code[instIndex++]);
+ ASSERT_EQ(SpvAddressingModelPhysical64, binary->code[instIndex++]);
+ ASSERT_EQ(SpvMemoryModelOpenCL, binary->code[instIndex++]);
uint16_t sourceExtensionWordCount =
(uint16_t)((strlen("PlaceholderExtensionName") / sizeof(uint32_t)) + 2);
- ASSERT_EQ(spvOpcodeMake(sourceExtensionWordCount, OpSourceExtension),
+ ASSERT_EQ(spvOpcodeMake(sourceExtensionWordCount, SpvOpSourceExtension),
binary->code[instIndex++]);
// TODO: This only works on little endian systems!
char_word_t cw = {{'P', 'l', 'a', 'c'}};
ASSERT_EQ(spvFixWord(cw.u, endian), binary->code[instIndex++]);
ASSERT_EQ(0, binary->code[instIndex++]);
- ASSERT_EQ(spvOpcodeMake(4, OpEntryPoint), binary->code[instIndex++]);
- ASSERT_EQ(ExecutionModelKernel, binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpEntryPoint), binary->code[instIndex++]);
+ ASSERT_EQ(SpvExecutionModelKernel, binary->code[instIndex++]);
ASSERT_EQ(1, binary->code[instIndex++]);
cw = {{'f', 'o', 'o', 0}};
ASSERT_EQ(spvFixWord(cw.u, endian), binary->code[instIndex++]);
- ASSERT_EQ(spvOpcodeMake(6, OpExecutionMode), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(6, SpvOpExecutionMode), binary->code[instIndex++]);
ASSERT_EQ(1, binary->code[instIndex++]);
- ASSERT_EQ(ExecutionModeLocalSizeHint, binary->code[instIndex++]);
+ ASSERT_EQ(SpvExecutionModeLocalSizeHint, binary->code[instIndex++]);
ASSERT_EQ(1, binary->code[instIndex++]);
ASSERT_EQ(1, binary->code[instIndex++]);
ASSERT_EQ(1, binary->code[instIndex++]);
- ASSERT_EQ(spvOpcodeMake(2, OpTypeVoid), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(2, SpvOpTypeVoid), binary->code[instIndex++]);
ASSERT_EQ(2, binary->code[instIndex++]);
- ASSERT_EQ(spvOpcodeMake(2, OpTypeBool), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(2, SpvOpTypeBool), binary->code[instIndex++]);
ASSERT_EQ(3, binary->code[instIndex++]);
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(4, binary->code[instIndex++]);
ASSERT_EQ(8, binary->code[instIndex++]); // NOTE: 8 bits wide
ASSERT_EQ(0, binary->code[instIndex++]); // NOTE: Unsigned
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(5, binary->code[instIndex++]);
ASSERT_EQ(8, binary->code[instIndex++]); // NOTE: 8 bits wide
ASSERT_EQ(1, binary->code[instIndex++]); // NOTE: Signed
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(6, binary->code[instIndex++]);
ASSERT_EQ(16, binary->code[instIndex++]); // NOTE: 16 bits wide
ASSERT_EQ(0, binary->code[instIndex++]); // NOTE: Unsigned
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(7, binary->code[instIndex++]);
ASSERT_EQ(16, binary->code[instIndex++]); // NOTE: 16 bits wide
ASSERT_EQ(1, binary->code[instIndex++]); // NOTE: Signed
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(8, binary->code[instIndex++]);
ASSERT_EQ(32, binary->code[instIndex++]); // NOTE: 32 bits wide
ASSERT_EQ(0, binary->code[instIndex++]); // NOTE: Unsigned
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(9, binary->code[instIndex++]);
ASSERT_EQ(32, binary->code[instIndex++]); // NOTE: 32 bits wide
ASSERT_EQ(1, binary->code[instIndex++]); // NOTE: Signed
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(10, binary->code[instIndex++]);
ASSERT_EQ(64, binary->code[instIndex++]); // NOTE: 64 bits wide
ASSERT_EQ(0, binary->code[instIndex++]); // NOTE: Unsigned
- ASSERT_EQ(spvOpcodeMake(4, OpTypeInt), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeInt), binary->code[instIndex++]);
ASSERT_EQ(11, binary->code[instIndex++]);
ASSERT_EQ(64, binary->code[instIndex++]); // NOTE: 64 bits wide
ASSERT_EQ(1, binary->code[instIndex++]); // NOTE: Signed
- ASSERT_EQ(spvOpcodeMake(3, OpTypeFloat), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(3, SpvOpTypeFloat), binary->code[instIndex++]);
ASSERT_EQ(12, binary->code[instIndex++]);
ASSERT_EQ(16, binary->code[instIndex++]); // NOTE: 16 bits wide
- ASSERT_EQ(spvOpcodeMake(3, OpTypeFloat), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(3, SpvOpTypeFloat), binary->code[instIndex++]);
ASSERT_EQ(13, binary->code[instIndex++]);
ASSERT_EQ(32, binary->code[instIndex++]); // NOTE: 32 bits wide
- ASSERT_EQ(spvOpcodeMake(3, OpTypeFloat), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(3, SpvOpTypeFloat), binary->code[instIndex++]);
ASSERT_EQ(14, binary->code[instIndex++]);
ASSERT_EQ(64, binary->code[instIndex++]); // NOTE: 64 bits wide
- ASSERT_EQ(spvOpcodeMake(4, OpTypeVector), binary->code[instIndex++]);
+ ASSERT_EQ(spvOpcodeMake(4, SpvOpTypeVector), binary->code[instIndex++]);
ASSERT_EQ(15, binary->code[instIndex++]);
ASSERT_EQ(4, binary->code[instIndex++]);
ASSERT_EQ(2, binary->code[instIndex++]);
// Returns a vector of words representing a single instruction with the
// given opcode and operand words as a vector.
inline std::vector<uint32_t> MakeInstruction(
- spv::Op opcode, const std::vector<uint32_t>& args) {
+ SpvOp opcode, const std::vector<uint32_t>& args) {
std::vector<uint32_t> result{
spvOpcodeMake(uint16_t(args.size() + 1), opcode)};
result.insert(result.end(), args.begin(), args.end());
// given opcode and whose operands are the concatenation of the two given
// argument lists.
inline std::vector<uint32_t> MakeInstruction(
- spv::Op opcode, std::vector<uint32_t> args,
+ SpvOp opcode, std::vector<uint32_t> args,
const std::vector<uint32_t>& extra_args) {
args.insert(args.end(), extra_args.begin(), extra_args.end());
return MakeInstruction(opcode, args);