diff options
-rw-r--r-- | include/spirv/spir-v.xml | 3 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.bf | 41 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.core.grammar.json | 175 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.cs | 41 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.h | 45 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.hpp | 49 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.hpp11 | 49 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.json | 44 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.lua | 37 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.py | 37 | ||||
-rw-r--r-- | include/spirv/unified1/spv.d | 41 | ||||
-rw-r--r-- | tools/buildHeaders/jsonToSpirv.cpp | 15 | ||||
-rw-r--r-- | tools/buildHeaders/jsonToSpirv.h | 3 |
13 files changed, 577 insertions, 3 deletions
diff --git a/include/spirv/spir-v.xml b/include/spirv/spir-v.xml index b6cad39..989b996 100644 --- a/include/spirv/spir-v.xml +++ b/include/spirv/spir-v.xml @@ -89,7 +89,8 @@ <id value="36" vendor="Taichi Graphics" tool="Taichi" comment="Contact Rendong Liang rendongliang@taichi.graphics, Repo https://github.com/taichi-dev/taichi"/> <id value="37" vendor="heroseh" tool="Hero C Compiler" comment="https://github.com/heroseh/hcc"/> <id value="38" vendor="Meta" tool="SparkSL" comment="Contact Dunfan Lu, dunfanlu@meta.com, https://sparkar.facebook.com/ar-studio/learn/sparksl/sparksl-overview"/> - <unused start="39" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/> + <id value="39" vendor="SirLynix" tool="Nazara ShaderLang Compiler" comment="Contact Jérôme Leclercq, https://github.com/NazaraEngine/ShaderLang"/> + <unused start="40" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/> </ids> <!-- SECTION: SPIR-V Opcodes and Enumerants --> diff --git a/include/spirv/unified1/spirv.bf b/include/spirv/unified1/spirv.bf index 9df763d..d1e90cb 100644 --- a/include/spirv/unified1/spirv.bf +++ b/include/spirv/unified1/spirv.bf @@ -67,6 +67,7 @@ namespace Spv CPP_for_OpenCL = 6, SYCL = 7, HERO_C = 8, + NZSL = 9, } [AllowDuplicates, CRepr] public enum ExecutionModel @@ -354,6 +355,8 @@ namespace Spv Float = 14, UnormInt24 = 15, UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, } [AllowDuplicates, CRepr] public enum ImageOperandsShift @@ -1158,6 +1161,7 @@ namespace Spv DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1279,6 +1283,38 @@ namespace Spv PackedVectorFormat4x8BitKHR = 0, } + [AllowDuplicates, CRepr] public enum CooperativeMatrixOperandsShift + { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + } + + [AllowDuplicates, CRepr] public enum CooperativeMatrixOperandsMask + { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, + } + + [AllowDuplicates, CRepr] public enum CooperativeMatrixLayout + { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + } + + [AllowDuplicates, CRepr] public enum CooperativeMatrixUse + { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + } + [AllowDuplicates, CRepr] public enum Op { OpNop = 0, @@ -1653,6 +1689,11 @@ namespace Spv OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.core.grammar.json b/include/spirv/unified1/spirv.core.grammar.json index 6908d84..f33d169 100644 --- a/include/spirv/unified1/spirv.core.grammar.json +++ b/include/spirv/unified1/spirv.core.grammar.json @@ -4494,6 +4494,77 @@ "version" : "1.6" }, { + "opname" : "OpTypeCooperativeMatrixKHR", + "class" : "Type-Declaration", + "opcode" : 4456, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Component Type'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdRef", "name" : "'Rows'" }, + { "kind" : "IdRef", "name" : "'Columns'" }, + { "kind" : "IdRef", "name" : "'Use'" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixLoadKHR", + "class" : "Memory", + "opcode" : 4457, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'MemoryLayout'" }, + { "kind" : "IdRef", "name" : "'Stride'", "quantifier": "?" }, + { "kind" : "MemoryAccess", "name" : "'Memory Operand'", "quantifier" : "?" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixStoreKHR", + "class" : "Memory", + "opcode" : 4458, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "IdRef", "name" : "'MemoryLayout'" }, + { "kind" : "IdRef", "name" : "'Stride'", "quantifier": "?" }, + { "kind" : "MemoryAccess", "name" : "'Memory Operand'", "quantifier" : "?" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixMulAddKHR", + "class" : "Arithmetic", + "opcode" : 4459, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'A'" }, + { "kind" : "IdRef", "name" : "'B'" }, + { "kind" : "IdRef", "name" : "'C'" }, + { "kind" : "CooperativeMatrixOperands", "name" : "'Cooperative Matrix Operands'", "quantifier" : "?" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixLengthKHR", + "class" : "Miscellaneous", + "opcode" : 4460, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Type'" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { "opname" : "OpTypeRayQueryKHR", "class" : "Reserved", "opcode" : 4472, @@ -10088,6 +10159,10 @@ { "enumerant" : "HERO_C", "value" : 8 + }, + { + "enumerant" : "NZSL", + "value" : 9 } ] }, @@ -11610,6 +11685,16 @@ "enumerant" : "UnormInt101010_2", "value" : 16, "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedIntRaw10EXT", + "value" : 19, + "capabilities" : [ "Kernel" ] + }, + { + "enumerant" : "UnsignedIntRaw12EXT", + "value" : 20, + "capabilities" : [ "Kernel" ] } ] }, @@ -15109,6 +15194,12 @@ "version" : "None" }, { + "enumerant" : "CooperativeMatrixKHR", + "value" : 6022, + "extensions" : [ "SPV_KHR_cooperative_matrix" ], + "version" : "None" + }, + { "enumerant" : "BitInstructions", "value" : 6025, "extensions" : [ "SPV_KHR_bit_instructions" ], @@ -15274,6 +15365,90 @@ ] }, { + "category" : "BitEnum", + "kind" : "CooperativeMatrixOperands", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixASignedComponents", + "value" : "0x0001", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixBSignedComponents", + "value" : "0x0002", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixCSignedComponents", + "value" : "0x0004", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixResultSignedComponents", + "value" : "0x0008", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "SaturatingAccumulation", + "value" : "0x0010", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "CooperativeMatrixLayout", + "enumerants" : [ + { + "enumerant" : "RowMajorKHR", + "value" : 0, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "ColumnMajorKHR", + "value" : 1, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "CooperativeMatrixUse", + "enumerants" : [ + { + "enumerant" : "MatrixAKHR", + "value" : 0, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixBKHR", + "value" : 1, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixAccumulatorKHR", + "value" : 2, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + } + ] + }, + { "category" : "Id", "kind" : "IdResultType", "doc" : "Reference to an <id> representing the result's type of the enclosing instruction" diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs index b65a738..aca7744 100644 --- a/include/spirv/unified1/spirv.cs +++ b/include/spirv/unified1/spirv.cs @@ -66,6 +66,7 @@ namespace Spv CPP_for_OpenCL = 6, SYCL = 7, HERO_C = 8, + NZSL = 9, } public enum ExecutionModel @@ -353,6 +354,8 @@ namespace Spv Float = 14, UnormInt24 = 15, UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, } public enum ImageOperandsShift @@ -1157,6 +1160,7 @@ namespace Spv DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1278,6 +1282,38 @@ namespace Spv PackedVectorFormat4x8BitKHR = 0, } + public enum CooperativeMatrixOperandsShift + { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + } + + public enum CooperativeMatrixOperandsMask + { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, + } + + public enum CooperativeMatrixLayout + { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + } + + public enum CooperativeMatrixUse + { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + } + public enum Op { OpNop = 0, @@ -1652,6 +1688,11 @@ namespace Spv OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h index b204282..861399f 100644 --- a/include/spirv/unified1/spirv.h +++ b/include/spirv/unified1/spirv.h @@ -74,6 +74,7 @@ typedef enum SpvSourceLanguage_ { SpvSourceLanguageCPP_for_OpenCL = 6, SpvSourceLanguageSYCL = 7, SpvSourceLanguageHERO_C = 8, + SpvSourceLanguageNZSL = 9, SpvSourceLanguageMax = 0x7fffffff, } SpvSourceLanguage; @@ -361,6 +362,8 @@ typedef enum SpvImageChannelDataType_ { SpvImageChannelDataTypeFloat = 14, SpvImageChannelDataTypeUnormInt24 = 15, SpvImageChannelDataTypeUnormInt101010_2 = 16, + SpvImageChannelDataTypeUnsignedIntRaw10EXT = 19, + SpvImageChannelDataTypeUnsignedIntRaw12EXT = 20, SpvImageChannelDataTypeMax = 0x7fffffff, } SpvImageChannelDataType; @@ -1157,6 +1160,7 @@ typedef enum SpvCapability_ { SpvCapabilityDotProduct = 6019, SpvCapabilityDotProductKHR = 6019, SpvCapabilityRayCullMaskKHR = 6020, + SpvCapabilityCooperativeMatrixKHR = 6022, SpvCapabilityBitInstructions = 6025, SpvCapabilityGroupNonUniformRotateKHR = 6026, SpvCapabilityAtomicFloat32AddEXT = 6033, @@ -1277,6 +1281,37 @@ typedef enum SpvPackedVectorFormat_ { SpvPackedVectorFormatMax = 0x7fffffff, } SpvPackedVectorFormat; +typedef enum SpvCooperativeMatrixOperandsShift_ { + SpvCooperativeMatrixOperandsMatrixASignedComponentsShift = 0, + SpvCooperativeMatrixOperandsMatrixBSignedComponentsShift = 1, + SpvCooperativeMatrixOperandsMatrixCSignedComponentsShift = 2, + SpvCooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3, + SpvCooperativeMatrixOperandsSaturatingAccumulationShift = 4, + SpvCooperativeMatrixOperandsMax = 0x7fffffff, +} SpvCooperativeMatrixOperandsShift; + +typedef enum SpvCooperativeMatrixOperandsMask_ { + SpvCooperativeMatrixOperandsMaskNone = 0, + SpvCooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001, + SpvCooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002, + SpvCooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004, + SpvCooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008, + SpvCooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010, +} SpvCooperativeMatrixOperandsMask; + +typedef enum SpvCooperativeMatrixLayout_ { + SpvCooperativeMatrixLayoutRowMajorKHR = 0, + SpvCooperativeMatrixLayoutColumnMajorKHR = 1, + SpvCooperativeMatrixLayoutMax = 0x7fffffff, +} SpvCooperativeMatrixLayout; + +typedef enum SpvCooperativeMatrixUse_ { + SpvCooperativeMatrixUseMatrixAKHR = 0, + SpvCooperativeMatrixUseMatrixBKHR = 1, + SpvCooperativeMatrixUseMatrixAccumulatorKHR = 2, + SpvCooperativeMatrixUseMax = 0x7fffffff, +} SpvCooperativeMatrixUse; + typedef enum SpvOp_ { SpvOpNop = 0, SpvOpUndef = 1, @@ -1650,6 +1685,11 @@ typedef enum SpvOp_ { SpvOpUDotAccSatKHR = 4454, SpvOpSUDotAccSat = 4455, SpvOpSUDotAccSatKHR = 4455, + SpvOpTypeCooperativeMatrixKHR = 4456, + SpvOpCooperativeMatrixLoadKHR = 4457, + SpvOpCooperativeMatrixStoreKHR = 4458, + SpvOpCooperativeMatrixMulAddKHR = 4459, + SpvOpCooperativeMatrixLengthKHR = 4460, SpvOpTypeRayQueryKHR = 4472, SpvOpRayQueryInitializeKHR = 4473, SpvOpRayQueryTerminateKHR = 4474, @@ -2368,6 +2408,11 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpSDotAccSat: *hasResult = true; *hasResultType = true; break; case SpvOpUDotAccSat: *hasResult = true; *hasResultType = true; break; case SpvOpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case SpvOpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp index 74b0f36..b1330ab 100644 --- a/include/spirv/unified1/spirv.hpp +++ b/include/spirv/unified1/spirv.hpp @@ -70,6 +70,7 @@ enum SourceLanguage { SourceLanguageCPP_for_OpenCL = 6, SourceLanguageSYCL = 7, SourceLanguageHERO_C = 8, + SourceLanguageNZSL = 9, SourceLanguageMax = 0x7fffffff, }; @@ -357,6 +358,8 @@ enum ImageChannelDataType { ImageChannelDataTypeFloat = 14, ImageChannelDataTypeUnormInt24 = 15, ImageChannelDataTypeUnormInt101010_2 = 16, + ImageChannelDataTypeUnsignedIntRaw10EXT = 19, + ImageChannelDataTypeUnsignedIntRaw12EXT = 20, ImageChannelDataTypeMax = 0x7fffffff, }; @@ -1153,6 +1156,7 @@ enum Capability { CapabilityDotProduct = 6019, CapabilityDotProductKHR = 6019, CapabilityRayCullMaskKHR = 6020, + CapabilityCooperativeMatrixKHR = 6022, CapabilityBitInstructions = 6025, CapabilityGroupNonUniformRotateKHR = 6026, CapabilityAtomicFloat32AddEXT = 6033, @@ -1273,6 +1277,37 @@ enum PackedVectorFormat { PackedVectorFormatMax = 0x7fffffff, }; +enum CooperativeMatrixOperandsShift { + CooperativeMatrixOperandsMatrixASignedComponentsShift = 0, + CooperativeMatrixOperandsMatrixBSignedComponentsShift = 1, + CooperativeMatrixOperandsMatrixCSignedComponentsShift = 2, + CooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3, + CooperativeMatrixOperandsSaturatingAccumulationShift = 4, + CooperativeMatrixOperandsMax = 0x7fffffff, +}; + +enum CooperativeMatrixOperandsMask { + CooperativeMatrixOperandsMaskNone = 0, + CooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001, + CooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002, + CooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004, + CooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008, + CooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010, +}; + +enum CooperativeMatrixLayout { + CooperativeMatrixLayoutRowMajorKHR = 0, + CooperativeMatrixLayoutColumnMajorKHR = 1, + CooperativeMatrixLayoutMax = 0x7fffffff, +}; + +enum CooperativeMatrixUse { + CooperativeMatrixUseMatrixAKHR = 0, + CooperativeMatrixUseMatrixBKHR = 1, + CooperativeMatrixUseMatrixAccumulatorKHR = 2, + CooperativeMatrixUseMax = 0x7fffffff, +}; + enum Op { OpNop = 0, OpUndef = 1, @@ -1646,6 +1681,11 @@ enum Op { OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -2364,6 +2404,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpSDotAccSat: *hasResult = true; *hasResultType = true; break; case OpUDotAccSat: *hasResult = true; *hasResultType = true; break; case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; @@ -2746,6 +2791,10 @@ inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShad inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +inline CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } } // end namespace spv diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 index 561c1a8..2b5aa5c 100644 --- a/include/spirv/unified1/spirv.hpp11 +++ b/include/spirv/unified1/spirv.hpp11 @@ -70,6 +70,7 @@ enum class SourceLanguage : unsigned { CPP_for_OpenCL = 6, SYCL = 7, HERO_C = 8, + NZSL = 9, Max = 0x7fffffff, }; @@ -357,6 +358,8 @@ enum class ImageChannelDataType : unsigned { Float = 14, UnormInt24 = 15, UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, Max = 0x7fffffff, }; @@ -1153,6 +1156,7 @@ enum class Capability : unsigned { DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1273,6 +1277,37 @@ enum class PackedVectorFormat : unsigned { Max = 0x7fffffff, }; +enum class CooperativeMatrixOperandsShift : unsigned { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, +}; + +enum class CooperativeMatrixLayout : unsigned { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixUse : unsigned { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + Max = 0x7fffffff, +}; + enum class Op : unsigned { OpNop = 0, OpUndef = 1, @@ -1646,6 +1681,11 @@ enum class Op : unsigned { OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -2364,6 +2404,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break; case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break; case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; @@ -2746,6 +2791,10 @@ constexpr FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentS constexpr FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } constexpr FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } constexpr FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +constexpr CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } } // end namespace spv diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json index 973109b..df8c8b9 100644 --- a/include/spirv/unified1/spirv.json +++ b/include/spirv/unified1/spirv.json @@ -76,7 +76,8 @@ "HLSL": 5, "CPP_for_OpenCL": 6, "SYCL": 7, - "HERO_C": 8 + "HERO_C": 8, + "NZSL": 9 } }, { @@ -396,7 +397,9 @@ "HalfFloat": 13, "Float": 14, "UnormInt24": 15, - "UnormInt101010_2": 16 + "UnormInt101010_2": 16, + "UnsignedIntRaw10EXT": 19, + "UnsignedIntRaw12EXT": 20 } }, { @@ -1133,6 +1136,7 @@ "DotProduct": 6019, "DotProductKHR": 6019, "RayCullMaskKHR": 6020, + "CooperativeMatrixKHR": 6022, "BitInstructions": 6025, "GroupNonUniformRotateKHR": 6026, "AtomicFloat32AddEXT": 6033, @@ -1260,6 +1264,37 @@ } }, { + "Name": "CooperativeMatrixOperands", + "Type": "Bit", + "Values": + { + "MatrixASignedComponents": 0, + "MatrixBSignedComponents": 1, + "MatrixCSignedComponents": 2, + "MatrixResultSignedComponents": 3, + "SaturatingAccumulation": 4 + } + }, + { + "Name": "CooperativeMatrixLayout", + "Type": "Value", + "Values": + { + "RowMajorKHR": 0, + "ColumnMajorKHR": 1 + } + }, + { + "Name": "CooperativeMatrixUse", + "Type": "Value", + "Values": + { + "MatrixAKHR": 0, + "MatrixBKHR": 1, + "MatrixAccumulatorKHR": 2 + } + }, + { "Name": "Op", "Type": "Value", "Values": @@ -1636,6 +1671,11 @@ "OpUDotAccSatKHR": 4454, "OpSUDotAccSat": 4455, "OpSUDotAccSatKHR": 4455, + "OpTypeCooperativeMatrixKHR": 4456, + "OpCooperativeMatrixLoadKHR": 4457, + "OpCooperativeMatrixStoreKHR": 4458, + "OpCooperativeMatrixMulAddKHR": 4459, + "OpCooperativeMatrixLengthKHR": 4460, "OpTypeRayQueryKHR": 4472, "OpRayQueryInitializeKHR": 4473, "OpRayQueryTerminateKHR": 4474, diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua index acf7252..3c07ddb 100644 --- a/include/spirv/unified1/spirv.lua +++ b/include/spirv/unified1/spirv.lua @@ -61,6 +61,7 @@ spv = { CPP_for_OpenCL = 6, SYCL = 7, HERO_C = 8, + NZSL = 9, }, ExecutionModel = { @@ -337,6 +338,8 @@ spv = { Float = 14, UnormInt24 = 15, UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, }, ImageOperandsShift = { @@ -1115,6 +1118,7 @@ spv = { DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1224,6 +1228,34 @@ spv = { PackedVectorFormat4x8BitKHR = 0, }, + CooperativeMatrixOperandsShift = { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + }, + + CooperativeMatrixOperandsMask = { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, + }, + + CooperativeMatrixLayout = { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + }, + + CooperativeMatrixUse = { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + }, + Op = { OpNop = 0, OpUndef = 1, @@ -1597,6 +1629,11 @@ spv = { OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py index d1e6104..bc73928 100644 --- a/include/spirv/unified1/spirv.py +++ b/include/spirv/unified1/spirv.py @@ -61,6 +61,7 @@ spv = { 'CPP_for_OpenCL' : 6, 'SYCL' : 7, 'HERO_C' : 8, + 'NZSL' : 9, }, 'ExecutionModel' : { @@ -337,6 +338,8 @@ spv = { 'Float' : 14, 'UnormInt24' : 15, 'UnormInt101010_2' : 16, + 'UnsignedIntRaw10EXT' : 19, + 'UnsignedIntRaw12EXT' : 20, }, 'ImageOperandsShift' : { @@ -1115,6 +1118,7 @@ spv = { 'DotProduct' : 6019, 'DotProductKHR' : 6019, 'RayCullMaskKHR' : 6020, + 'CooperativeMatrixKHR' : 6022, 'BitInstructions' : 6025, 'GroupNonUniformRotateKHR' : 6026, 'AtomicFloat32AddEXT' : 6033, @@ -1224,6 +1228,34 @@ spv = { 'PackedVectorFormat4x8BitKHR' : 0, }, + 'CooperativeMatrixOperandsShift' : { + 'MatrixASignedComponents' : 0, + 'MatrixBSignedComponents' : 1, + 'MatrixCSignedComponents' : 2, + 'MatrixResultSignedComponents' : 3, + 'SaturatingAccumulation' : 4, + }, + + 'CooperativeMatrixOperandsMask' : { + 'MaskNone' : 0, + 'MatrixASignedComponents' : 0x00000001, + 'MatrixBSignedComponents' : 0x00000002, + 'MatrixCSignedComponents' : 0x00000004, + 'MatrixResultSignedComponents' : 0x00000008, + 'SaturatingAccumulation' : 0x00000010, + }, + + 'CooperativeMatrixLayout' : { + 'RowMajorKHR' : 0, + 'ColumnMajorKHR' : 1, + }, + + 'CooperativeMatrixUse' : { + 'MatrixAKHR' : 0, + 'MatrixBKHR' : 1, + 'MatrixAccumulatorKHR' : 2, + }, + 'Op' : { 'OpNop' : 0, 'OpUndef' : 1, @@ -1597,6 +1629,11 @@ spv = { 'OpUDotAccSatKHR' : 4454, 'OpSUDotAccSat' : 4455, 'OpSUDotAccSatKHR' : 4455, + 'OpTypeCooperativeMatrixKHR' : 4456, + 'OpCooperativeMatrixLoadKHR' : 4457, + 'OpCooperativeMatrixStoreKHR' : 4458, + 'OpCooperativeMatrixMulAddKHR' : 4459, + 'OpCooperativeMatrixLengthKHR' : 4460, 'OpTypeRayQueryKHR' : 4472, 'OpRayQueryInitializeKHR' : 4473, 'OpRayQueryTerminateKHR' : 4474, diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d index 4d92bf8..591ab17 100644 --- a/include/spirv/unified1/spv.d +++ b/include/spirv/unified1/spv.d @@ -69,6 +69,7 @@ enum SourceLanguage : uint CPP_for_OpenCL = 6, SYCL = 7, HERO_C = 8, + NZSL = 9, } enum ExecutionModel : uint @@ -356,6 +357,8 @@ enum ImageChannelDataType : uint Float = 14, UnormInt24 = 15, UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, } enum ImageOperandsShift : uint @@ -1160,6 +1163,7 @@ enum Capability : uint DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1281,6 +1285,38 @@ enum PackedVectorFormat : uint PackedVectorFormat4x8BitKHR = 0, } +enum CooperativeMatrixOperandsShift : uint +{ + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, +} + +enum CooperativeMatrixOperandsMask : uint +{ + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, +} + +enum CooperativeMatrixLayout : uint +{ + RowMajorKHR = 0, + ColumnMajorKHR = 1, +} + +enum CooperativeMatrixUse : uint +{ + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, +} + enum Op : uint { OpNop = 0, @@ -1655,6 +1691,11 @@ enum Op : uint OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/tools/buildHeaders/jsonToSpirv.cpp b/tools/buildHeaders/jsonToSpirv.cpp index 67b5bce..1f2cb77 100644 --- a/tools/buildHeaders/jsonToSpirv.cpp +++ b/tools/buildHeaders/jsonToSpirv.cpp @@ -88,6 +88,9 @@ EnumValues RayQueryCommittedIntersectionTypeParams; EnumValues RayQueryCandidateIntersectionTypeParams; EnumValues FragmentShadingRateParams; EnumValues PackedVectorFormatParams; +EnumValues CooperativeMatrixOperandsParams; +EnumValues CooperativeMatrixLayoutParams; +EnumValues CooperativeMatrixUseParams; std::pair<bool, std::string> ReadFile(const std::string& path) { @@ -234,6 +237,12 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co type = OperandFragmentShadingRate; } else if (operandKind == "PackedVectorFormat") { type = OperandPackedVectorFormat; + } else if (operandKind == "CooperativeMatrixOperands") { + type = OperandCooperativeMatrixOperands; + } else if (operandKind == "CooperativeMatrixLayout") { + type = OperandCooperativeMatrixLayout; + } else if (operandKind == "CooperativeMatrixUse") { + type = OperandCooperativeMatrixUse; } if (type == OperandNone) { @@ -544,6 +553,12 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) establishOperandClass(enumName, OperandFragmentShadingRate, &FragmentShadingRateParams, operandEnum, category); } else if (enumName == "PackedVectorFormat") { establishOperandClass(enumName, OperandPackedVectorFormat, &PackedVectorFormatParams, operandEnum, category); + } else if (enumName == "CooperativeMatrixOperands") { + establishOperandClass(enumName, OperandCooperativeMatrixOperands, &CooperativeMatrixOperandsParams, operandEnum, category); + } else if (enumName == "CooperativeMatrixLayout") { + establishOperandClass(enumName, OperandCooperativeMatrixLayout, &CooperativeMatrixLayoutParams, operandEnum, category); + } else if (enumName == "CooperativeMatrixUse") { + establishOperandClass(enumName, OperandCooperativeMatrixUse, &CooperativeMatrixUseParams, operandEnum, category); } } } diff --git a/tools/buildHeaders/jsonToSpirv.h b/tools/buildHeaders/jsonToSpirv.h index 3be6456..a5db3a2 100644 --- a/tools/buildHeaders/jsonToSpirv.h +++ b/tools/buildHeaders/jsonToSpirv.h @@ -96,6 +96,9 @@ enum OperandClass { OperandQuantizationModes, OperandOverflowModes, OperandPackedVectorFormat, + OperandCooperativeMatrixOperands, + OperandCooperativeMatrixLayout, + OperandCooperativeMatrixUse, OperandOpcode, |