diff --git a/.gitignore b/.gitignore index a82ac601d..e4e789fa5 100644 --- a/.gitignore +++ b/.gitignore @@ -245,6 +245,7 @@ ModelManifest.xml # Rider .idea/ +Src/.idea/ # macOS .DS_Store diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..a7170a45b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Tools/SPIRVGenerationTool/SPIRV-Headers"] + path = Tools/SPIRVGenerationTool/SPIRV-Headers + url = https://github.com/KhronosGroup/SPIRV-Headers diff --git a/Src/ILGPU/Backends/SPIRV/BinarySPIRVBuilder.cs b/Src/ILGPU/Backends/SPIRV/BinarySPIRVBuilder.cs new file mode 100644 index 000000000..0f314af33 --- /dev/null +++ b/Src/ILGPU/Backends/SPIRV/BinarySPIRVBuilder.cs @@ -0,0 +1,10439 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: BinarySPIRVBuilder.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using System; +using System.Linq; +using System.Collections.Generic; +using ILGPU.Backends.SPIRV.Types; + +// disable: max_line_length + +#nullable enable + +namespace ILGPU.Backends.SPIRV { + + internal class BinarySPIRVBuilder : ISPIRVBuilder + { + + private readonly List _instructions = new List(); + + public byte[] ToByteArray() => _instructions + .Select(x => x.Data) + .Select(x => BitConverter.GetBytes(x)) + .SelectMany(x => x) + .ToArray(); + + public void AddMetadata( + SPIRVWord magic, + SPIRVWord version, + SPIRVWord genMagic, + SPIRVWord bound, + SPIRVWord schema) + { + _instructions.Add(magic); + _instructions.Add(version); + _instructions.Add(genMagic); + _instructions.Add(bound); + _instructions.Add(schema); + } + + public void Merge(ISPIRVBuilder other) + { + if(other == null) + throw new ArgumentNullException(nameof(other)); + + if(other is BinarySPIRVBuilder otherBinary) + { + _instructions.AddRange(otherBinary._instructions); + return; + } + + throw new InvalidCodeGenerationException( + "Attempted to merge string representation builder with binary builder" + ); + } + + public void GenerateOpNop() + { + ushort opCode = 0; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpUndef(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 1; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSourceContinued(LiteralString continuedSource) + { + var tempList = new List(); + tempList.AddRange(continuedSource.ToWords()); + ushort opCode = 2; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSource(SourceLanguage param0, LiteralInteger version, IdRef? file = null, LiteralString? source = null) + { + var tempList = new List(); + tempList.AddRange(param0.ToWords()); + tempList.AddRange(version.ToWords()); + if(file is IdRef fileNotNull) + tempList.AddRange(fileNotNull.ToWords()); + if(source is LiteralString sourceNotNull) + tempList.AddRange(sourceNotNull.ToWords()); + ushort opCode = 3; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSourceExtension(LiteralString extension) + { + var tempList = new List(); + tempList.AddRange(extension.ToWords()); + ushort opCode = 4; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpName(IdRef target, LiteralString name) + { + var tempList = new List(); + tempList.AddRange(target.ToWords()); + tempList.AddRange(name.ToWords()); + ushort opCode = 5; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMemberName(IdRef type, LiteralInteger member, LiteralString name) + { + var tempList = new List(); + tempList.AddRange(type.ToWords()); + tempList.AddRange(member.ToWords()); + tempList.AddRange(name.ToWords()); + ushort opCode = 6; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpString(IdResult resultId, LiteralString @string) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@string.ToWords()); + ushort opCode = 7; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLine(IdRef file, LiteralInteger line, LiteralInteger column) + { + var tempList = new List(); + tempList.AddRange(file.ToWords()); + tempList.AddRange(line.ToWords()); + tempList.AddRange(column.ToWords()); + ushort opCode = 8; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExtension(LiteralString name) + { + var tempList = new List(); + tempList.AddRange(name.ToWords()); + ushort opCode = 10; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExtInstImport(IdResult resultId, LiteralString name) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(name.ToWords()); + ushort opCode = 11; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExtInst(IdResultType resultType, IdResult resultId, IdRef set, LiteralExtInstInteger instruction, params IdRef[] operand1Operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(set.ToWords()); + tempList.AddRange(instruction.ToWords()); + foreach(var el in operand1Operand2) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 12; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMemoryModel(AddressingModel param0, MemoryModel param1) + { + var tempList = new List(); + tempList.AddRange(param0.ToWords()); + tempList.AddRange(param1.ToWords()); + ushort opCode = 14; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpEntryPoint(ExecutionModel param0, IdRef entryPoint, LiteralString name, params IdRef[] @interface) + { + var tempList = new List(); + tempList.AddRange(param0.ToWords()); + tempList.AddRange(entryPoint.ToWords()); + tempList.AddRange(name.ToWords()); + foreach(var el in @interface) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 15; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExecutionMode(IdRef entryPoint, ExecutionMode mode) + { + var tempList = new List(); + tempList.AddRange(entryPoint.ToWords()); + tempList.AddRange(mode.ToWords()); + ushort opCode = 16; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCapability(Capability capability) + { + var tempList = new List(); + tempList.AddRange(capability.ToWords()); + ushort opCode = 17; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeVoid(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 19; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeBool(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 20; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeInt(IdResult resultId, LiteralInteger width, LiteralInteger signedness) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(width.ToWords()); + tempList.AddRange(signedness.ToWords()); + ushort opCode = 21; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeFloat(IdResult resultId, LiteralInteger width) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(width.ToWords()); + ushort opCode = 22; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeVector(IdResult resultId, IdRef componentType, LiteralInteger componentCount) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(componentType.ToWords()); + tempList.AddRange(componentCount.ToWords()); + ushort opCode = 23; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeMatrix(IdResult resultId, IdRef columnType, LiteralInteger columnCount) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(columnType.ToWords()); + tempList.AddRange(columnCount.ToWords()); + ushort opCode = 24; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeImage(IdResult resultId, IdRef sampledType, Dim param2, LiteralInteger depth, LiteralInteger arrayed, LiteralInteger mS, LiteralInteger sampled, ImageFormat param7, AccessQualifier? param8 = null) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledType.ToWords()); + tempList.AddRange(param2.ToWords()); + tempList.AddRange(depth.ToWords()); + tempList.AddRange(arrayed.ToWords()); + tempList.AddRange(mS.ToWords()); + tempList.AddRange(sampled.ToWords()); + tempList.AddRange(param7.ToWords()); + if(param8 is AccessQualifier param8NotNull) + tempList.AddRange(param8NotNull.ToWords()); + ushort opCode = 25; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeSampler(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 26; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeSampledImage(IdResult resultId, IdRef imageType) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(imageType.ToWords()); + ushort opCode = 27; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeArray(IdResult resultId, IdRef elementType, IdRef length) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(elementType.ToWords()); + tempList.AddRange(length.ToWords()); + ushort opCode = 28; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeRuntimeArray(IdResult resultId, IdRef elementType) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(elementType.ToWords()); + ushort opCode = 29; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeStruct(IdResult resultId, params IdRef[] member0typemember1type) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + foreach(var el in member0typemember1type) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 30; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeOpaque(IdResult resultId, LiteralString thenameoftheopaquetype) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(thenameoftheopaquetype.ToWords()); + ushort opCode = 31; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypePointer(IdResult resultId, StorageClass param1, IdRef type) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(param1.ToWords()); + tempList.AddRange(type.ToWords()); + ushort opCode = 32; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeFunction(IdResult resultId, IdRef returnType, params IdRef[] parameter0TypeParameter1Type) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(returnType.ToWords()); + foreach(var el in parameter0TypeParameter1Type) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 33; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeEvent(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 34; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeDeviceEvent(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 35; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeReserveId(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 36; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeQueue(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 37; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypePipe(IdResult resultId, AccessQualifier qualifier) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(qualifier.ToWords()); + ushort opCode = 38; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeForwardPointer(IdRef pointerType, StorageClass param1) + { + var tempList = new List(); + tempList.AddRange(pointerType.ToWords()); + tempList.AddRange(param1.ToWords()); + ushort opCode = 39; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantTrue(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 41; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantFalse(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 42; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstant(IdResultType resultType, IdResult resultId, LiteralContextDependentNumber value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 43; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantComposite(IdResultType resultType, IdResult resultId, params IdRef[] constituents) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + foreach(var el in constituents) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 44; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantSampler(IdResultType resultType, IdResult resultId, SamplerAddressingMode param2, LiteralInteger param, SamplerFilterMode param4) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(param2.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(param4.ToWords()); + ushort opCode = 45; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantNull(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 46; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSpecConstantTrue(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 48; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSpecConstantFalse(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 49; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSpecConstant(IdResultType resultType, IdResult resultId, LiteralContextDependentNumber value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 50; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSpecConstantComposite(IdResultType resultType, IdResult resultId, params IdRef[] constituents) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + foreach(var el in constituents) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 51; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSpecConstantOp(IdResultType resultType, IdResult resultId, LiteralSpecConstantOpInteger opcode) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(opcode.ToWords()); + ushort opCode = 52; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFunction(IdResultType resultType, IdResult resultId, FunctionControl param2, IdRef functionType) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(param2.ToWords()); + tempList.AddRange(functionType.ToWords()); + ushort opCode = 54; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFunctionParameter(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 55; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFunctionEnd() + { + ushort opCode = 56; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpFunctionCall(IdResultType resultType, IdResult resultId, IdRef function, params IdRef[] argument0Argument1) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(function.ToWords()); + foreach(var el in argument0Argument1) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 57; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVariable(IdResultType resultType, IdResult resultId, StorageClass param2, IdRef? initializer = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(param2.ToWords()); + if(initializer is IdRef initializerNotNull) + tempList.AddRange(initializerNotNull.ToWords()); + ushort opCode = 59; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageTexelPointer(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, IdRef sample) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(sample.ToWords()); + ushort opCode = 60; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLoad(IdResultType resultType, IdResult resultId, IdRef pointer, MemoryAccess? param3 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + if(param3 is MemoryAccess param3NotNull) + tempList.AddRange(param3NotNull.ToWords()); + ushort opCode = 61; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpStore(IdRef pointer, IdRef @object, MemoryAccess? param2 = null) + { + var tempList = new List(); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(@object.ToWords()); + if(param2 is MemoryAccess param2NotNull) + tempList.AddRange(param2NotNull.ToWords()); + ushort opCode = 62; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCopyMemory(IdRef target, IdRef source, MemoryAccess? param2 = null, MemoryAccess? param3 = null) + { + var tempList = new List(); + tempList.AddRange(target.ToWords()); + tempList.AddRange(source.ToWords()); + if(param2 is MemoryAccess param2NotNull) + tempList.AddRange(param2NotNull.ToWords()); + if(param3 is MemoryAccess param3NotNull) + tempList.AddRange(param3NotNull.ToWords()); + ushort opCode = 63; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCopyMemorySized(IdRef target, IdRef source, IdRef size, MemoryAccess? param3 = null, MemoryAccess? param4 = null) + { + var tempList = new List(); + tempList.AddRange(target.ToWords()); + tempList.AddRange(source.ToWords()); + tempList.AddRange(size.ToWords()); + if(param3 is MemoryAccess param3NotNull) + tempList.AddRange(param3NotNull.ToWords()); + if(param4 is MemoryAccess param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 64; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, params IdRef[] indexes) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + foreach(var el in indexes) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 65; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpInBoundsAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, params IdRef[] indexes) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + foreach(var el in indexes) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 66; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpPtrAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, IdRef element, params IdRef[] indexes) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(element.ToWords()); + foreach(var el in indexes) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 67; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArrayLength(IdResultType resultType, IdResult resultId, IdRef structure, LiteralInteger arraymember) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(structure.ToWords()); + tempList.AddRange(arraymember.ToWords()); + ushort opCode = 68; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGenericPtrMemSemantics(IdResultType resultType, IdResult resultId, IdRef pointer) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + ushort opCode = 69; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpInBoundsPtrAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, IdRef element, params IdRef[] indexes) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(element.ToWords()); + foreach(var el in indexes) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 70; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDecorate(IdRef target, Decoration param1) + { + var tempList = new List(); + tempList.AddRange(target.ToWords()); + tempList.AddRange(param1.ToWords()); + ushort opCode = 71; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMemberDecorate(IdRef structureType, LiteralInteger member, Decoration param2) + { + var tempList = new List(); + tempList.AddRange(structureType.ToWords()); + tempList.AddRange(member.ToWords()); + tempList.AddRange(param2.ToWords()); + ushort opCode = 72; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDecorationGroup(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 73; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupDecorate(IdRef decorationGroup, params IdRef[] targets) + { + var tempList = new List(); + tempList.AddRange(decorationGroup.ToWords()); + foreach(var el in targets) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 74; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupMemberDecorate(IdRef decorationGroup, params PairIdRefLiteralInteger[] targets) + { + var tempList = new List(); + tempList.AddRange(decorationGroup.ToWords()); + foreach(var el in targets) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 75; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVectorExtractDynamic(IdResultType resultType, IdResult resultId, IdRef vector, IdRef index) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector.ToWords()); + tempList.AddRange(index.ToWords()); + ushort opCode = 77; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVectorInsertDynamic(IdResultType resultType, IdResult resultId, IdRef vector, IdRef component, IdRef index) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector.ToWords()); + tempList.AddRange(component.ToWords()); + tempList.AddRange(index.ToWords()); + ushort opCode = 78; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVectorShuffle(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, params LiteralInteger[] components) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + foreach(var el in components) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 79; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCompositeConstruct(IdResultType resultType, IdResult resultId, params IdRef[] constituents) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + foreach(var el in constituents) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 80; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCompositeExtract(IdResultType resultType, IdResult resultId, IdRef composite, params LiteralInteger[] indexes) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(composite.ToWords()); + foreach(var el in indexes) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 81; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCompositeInsert(IdResultType resultType, IdResult resultId, IdRef @object, IdRef composite, params LiteralInteger[] indexes) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@object.ToWords()); + tempList.AddRange(composite.ToWords()); + foreach(var el in indexes) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 82; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCopyObject(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 83; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTranspose(IdResultType resultType, IdResult resultId, IdRef matrix) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(matrix.ToWords()); + ushort opCode = 84; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSampledImage(IdResultType resultType, IdResult resultId, IdRef image, IdRef sampler) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(sampler.ToWords()); + ushort opCode = 86; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 87; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(param4.ToWords()); + ushort opCode = 88; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 89; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + tempList.AddRange(param5.ToWords()); + ushort opCode = 90; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleProjImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 91; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleProjExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(param4.ToWords()); + ushort opCode = 92; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleProjDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 93; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleProjDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + tempList.AddRange(param5.ToWords()); + ushort opCode = 94; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageFetch(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 95; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef component, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(component.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 96; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageDrefGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 97; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageRead(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 98; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageWrite(IdRef image, IdRef coordinate, IdRef texel, ImageOperands? param3 = null) + { + var tempList = new List(); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(texel.ToWords()); + if(param3 is ImageOperands param3NotNull) + tempList.AddRange(param3NotNull.ToWords()); + ushort opCode = 99; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImage(IdResultType resultType, IdResult resultId, IdRef sampledImage) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + ushort opCode = 100; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageQueryFormat(IdResultType resultType, IdResult resultId, IdRef image) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + ushort opCode = 101; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageQueryOrder(IdResultType resultType, IdResult resultId, IdRef image) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + ushort opCode = 102; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageQuerySizeLod(IdResultType resultType, IdResult resultId, IdRef image, IdRef levelofDetail) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(levelofDetail.ToWords()); + ushort opCode = 103; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageQuerySize(IdResultType resultType, IdResult resultId, IdRef image) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + ushort opCode = 104; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageQueryLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + ushort opCode = 105; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageQueryLevels(IdResultType resultType, IdResult resultId, IdRef image) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + ushort opCode = 106; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageQuerySamples(IdResultType resultType, IdResult resultId, IdRef image) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + ushort opCode = 107; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertFToU(IdResultType resultType, IdResult resultId, IdRef floatValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(floatValue.ToWords()); + ushort opCode = 109; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertFToS(IdResultType resultType, IdResult resultId, IdRef floatValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(floatValue.ToWords()); + ushort opCode = 110; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertSToF(IdResultType resultType, IdResult resultId, IdRef signedValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(signedValue.ToWords()); + ushort opCode = 111; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertUToF(IdResultType resultType, IdResult resultId, IdRef unsignedValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(unsignedValue.ToWords()); + ushort opCode = 112; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUConvert(IdResultType resultType, IdResult resultId, IdRef unsignedValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(unsignedValue.ToWords()); + ushort opCode = 113; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSConvert(IdResultType resultType, IdResult resultId, IdRef signedValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(signedValue.ToWords()); + ushort opCode = 114; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFConvert(IdResultType resultType, IdResult resultId, IdRef floatValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(floatValue.ToWords()); + ushort opCode = 115; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpQuantizeToF16(IdResultType resultType, IdResult resultId, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 116; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertPtrToU(IdResultType resultType, IdResult resultId, IdRef pointer) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + ushort opCode = 117; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSatConvertSToU(IdResultType resultType, IdResult resultId, IdRef signedValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(signedValue.ToWords()); + ushort opCode = 118; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSatConvertUToS(IdResultType resultType, IdResult resultId, IdRef unsignedValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(unsignedValue.ToWords()); + ushort opCode = 119; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertUToPtr(IdResultType resultType, IdResult resultId, IdRef integerValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(integerValue.ToWords()); + ushort opCode = 120; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpPtrCastToGeneric(IdResultType resultType, IdResult resultId, IdRef pointer) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + ushort opCode = 121; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGenericCastToPtr(IdResultType resultType, IdResult resultId, IdRef pointer) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + ushort opCode = 122; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGenericCastToPtrExplicit(IdResultType resultType, IdResult resultId, IdRef pointer, StorageClass storage) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(storage.ToWords()); + ushort opCode = 123; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitcast(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 124; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSNegate(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 126; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFNegate(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 127; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIAdd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 128; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFAdd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 129; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpISub(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 130; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFSub(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 131; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIMul(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 132; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFMul(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 133; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUDiv(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 134; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSDiv(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 135; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFDiv(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 136; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUMod(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 137; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSRem(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 138; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSMod(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 139; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFRem(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 140; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFMod(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 141; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVectorTimesScalar(IdResultType resultType, IdResult resultId, IdRef vector, IdRef scalar) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector.ToWords()); + tempList.AddRange(scalar.ToWords()); + ushort opCode = 142; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMatrixTimesScalar(IdResultType resultType, IdResult resultId, IdRef matrix, IdRef scalar) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(matrix.ToWords()); + tempList.AddRange(scalar.ToWords()); + ushort opCode = 143; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVectorTimesMatrix(IdResultType resultType, IdResult resultId, IdRef vector, IdRef matrix) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector.ToWords()); + tempList.AddRange(matrix.ToWords()); + ushort opCode = 144; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMatrixTimesVector(IdResultType resultType, IdResult resultId, IdRef matrix, IdRef vector) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(matrix.ToWords()); + tempList.AddRange(vector.ToWords()); + ushort opCode = 145; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMatrixTimesMatrix(IdResultType resultType, IdResult resultId, IdRef leftMatrix, IdRef rightMatrix) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(leftMatrix.ToWords()); + tempList.AddRange(rightMatrix.ToWords()); + ushort opCode = 146; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpOuterProduct(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + ushort opCode = 147; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + ushort opCode = 148; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIAddCarry(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 149; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpISubBorrow(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 150; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUMulExtended(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 151; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSMulExtended(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 152; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAny(IdResultType resultType, IdResult resultId, IdRef vector) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector.ToWords()); + ushort opCode = 154; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAll(IdResultType resultType, IdResult resultId, IdRef vector) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector.ToWords()); + ushort opCode = 155; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIsNan(IdResultType resultType, IdResult resultId, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 156; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIsInf(IdResultType resultType, IdResult resultId, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 157; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIsFinite(IdResultType resultType, IdResult resultId, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 158; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIsNormal(IdResultType resultType, IdResult resultId, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 159; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSignBitSet(IdResultType resultType, IdResult resultId, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 160; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLessOrGreater(IdResultType resultType, IdResult resultId, IdRef x, IdRef y) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + tempList.AddRange(y.ToWords()); + ushort opCode = 161; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpOrdered(IdResultType resultType, IdResult resultId, IdRef x, IdRef y) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + tempList.AddRange(y.ToWords()); + ushort opCode = 162; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUnordered(IdResultType resultType, IdResult resultId, IdRef x, IdRef y) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(x.ToWords()); + tempList.AddRange(y.ToWords()); + ushort opCode = 163; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLogicalEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 164; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLogicalNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 165; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLogicalOr(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 166; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLogicalAnd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 167; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLogicalNot(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 168; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSelect(IdResultType resultType, IdResult resultId, IdRef condition, IdRef object1, IdRef object2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(condition.ToWords()); + tempList.AddRange(object1.ToWords()); + tempList.AddRange(object2.ToWords()); + ushort opCode = 169; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 170; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpINotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 171; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 172; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 173; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 174; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 175; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpULessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 176; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSLessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 177; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpULessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 178; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSLessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 179; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFOrdEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 180; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFUnordEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 181; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFOrdNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 182; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFUnordNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 183; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFOrdLessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 184; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFUnordLessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 185; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFOrdGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 186; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFUnordGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 187; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFOrdLessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 188; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFUnordLessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 189; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFOrdGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 190; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFUnordGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 191; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpShiftRightLogical(IdResultType resultType, IdResult resultId, IdRef @base, IdRef shift) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(shift.ToWords()); + ushort opCode = 194; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpShiftRightArithmetic(IdResultType resultType, IdResult resultId, IdRef @base, IdRef shift) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(shift.ToWords()); + ushort opCode = 195; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpShiftLeftLogical(IdResultType resultType, IdResult resultId, IdRef @base, IdRef shift) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(shift.ToWords()); + ushort opCode = 196; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitwiseOr(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 197; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitwiseXor(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 198; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitwiseAnd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 199; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpNot(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 200; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitFieldInsert(IdResultType resultType, IdResult resultId, IdRef @base, IdRef insert, IdRef offset, IdRef count) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(insert.ToWords()); + tempList.AddRange(offset.ToWords()); + tempList.AddRange(count.ToWords()); + ushort opCode = 201; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitFieldSExtract(IdResultType resultType, IdResult resultId, IdRef @base, IdRef offset, IdRef count) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(offset.ToWords()); + tempList.AddRange(count.ToWords()); + ushort opCode = 202; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitFieldUExtract(IdResultType resultType, IdResult resultId, IdRef @base, IdRef offset, IdRef count) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + tempList.AddRange(offset.ToWords()); + tempList.AddRange(count.ToWords()); + ushort opCode = 203; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitReverse(IdResultType resultType, IdResult resultId, IdRef @base) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + ushort opCode = 204; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBitCount(IdResultType resultType, IdResult resultId, IdRef @base) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@base.ToWords()); + ushort opCode = 205; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDPdx(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 207; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDPdy(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 208; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFwidth(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 209; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDPdxFine(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 210; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDPdyFine(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 211; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFwidthFine(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 212; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDPdxCoarse(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 213; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDPdyCoarse(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 214; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFwidthCoarse(IdResultType resultType, IdResult resultId, IdRef p) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(p.ToWords()); + ushort opCode = 215; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpEmitVertex() + { + ushort opCode = 218; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpEndPrimitive() + { + ushort opCode = 219; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpEmitStreamVertex(IdRef stream) + { + var tempList = new List(); + tempList.AddRange(stream.ToWords()); + ushort opCode = 220; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpEndStreamPrimitive(IdRef stream) + { + var tempList = new List(); + tempList.AddRange(stream.ToWords()); + ushort opCode = 221; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpControlBarrier(IdScope execution, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 224; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMemoryBarrier(IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 225; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicLoad(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 227; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicStore(IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 228; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicExchange(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 229; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicCompareExchange(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics equal, IdMemorySemantics unequal, IdRef value, IdRef comparator) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(equal.ToWords()); + tempList.AddRange(unequal.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(comparator.ToWords()); + ushort opCode = 230; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicCompareExchangeWeak(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics equal, IdMemorySemantics unequal, IdRef value, IdRef comparator) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(equal.ToWords()); + tempList.AddRange(unequal.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(comparator.ToWords()); + ushort opCode = 231; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicIIncrement(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 232; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicIDecrement(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 233; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicIAdd(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 234; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicISub(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 235; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicSMin(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 236; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicUMin(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 237; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicSMax(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 238; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicUMax(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 239; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicAnd(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 240; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicOr(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 241; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicXor(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 242; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpPhi(IdResultType resultType, IdResult resultId, params PairIdRefIdRef[] variableParent) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + foreach(var el in variableParent) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 245; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLoopMerge(IdRef mergeBlock, IdRef continueTarget, LoopControl param2) + { + var tempList = new List(); + tempList.AddRange(mergeBlock.ToWords()); + tempList.AddRange(continueTarget.ToWords()); + tempList.AddRange(param2.ToWords()); + ushort opCode = 246; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSelectionMerge(IdRef mergeBlock, SelectionControl param1) + { + var tempList = new List(); + tempList.AddRange(mergeBlock.ToWords()); + tempList.AddRange(param1.ToWords()); + ushort opCode = 247; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLabel(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 248; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBranch(IdRef targetLabel) + { + var tempList = new List(); + tempList.AddRange(targetLabel.ToWords()); + ushort opCode = 249; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBranchConditional(IdRef condition, IdRef trueLabel, IdRef falseLabel, params LiteralInteger[] branchweights) + { + var tempList = new List(); + tempList.AddRange(condition.ToWords()); + tempList.AddRange(trueLabel.ToWords()); + tempList.AddRange(falseLabel.ToWords()); + foreach(var el in branchweights) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 250; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSwitch(IdRef selector, IdRef @default, params PairLiteralIntegerIdRef[] target) + { + var tempList = new List(); + tempList.AddRange(selector.ToWords()); + tempList.AddRange(@default.ToWords()); + foreach(var el in target) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 251; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpKill() + { + ushort opCode = 252; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpReturn() + { + ushort opCode = 253; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpReturnValue(IdRef value) + { + var tempList = new List(); + tempList.AddRange(value.ToWords()); + ushort opCode = 254; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUnreachable() + { + ushort opCode = 255; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpLifetimeStart(IdRef pointer, LiteralInteger size) + { + var tempList = new List(); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(size.ToWords()); + ushort opCode = 256; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLifetimeStop(IdRef pointer, LiteralInteger size) + { + var tempList = new List(); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(size.ToWords()); + ushort opCode = 257; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupAsyncCopy(IdResultType resultType, IdResult resultId, IdScope execution, IdRef destination, IdRef source, IdRef numElements, IdRef stride, IdRef @event) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(destination.ToWords()); + tempList.AddRange(source.ToWords()); + tempList.AddRange(numElements.ToWords()); + tempList.AddRange(stride.ToWords()); + tempList.AddRange(@event.ToWords()); + ushort opCode = 259; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupWaitEvents(IdScope execution, IdRef numEvents, IdRef eventsList) + { + var tempList = new List(); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(numEvents.ToWords()); + tempList.AddRange(eventsList.ToWords()); + ushort opCode = 260; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupAll(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 261; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupAny(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 262; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupBroadcast(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef localId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(localId.ToWords()); + ushort opCode = 263; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupIAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 264; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupFAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 265; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupFMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 266; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupUMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 267; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupSMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 268; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupFMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 269; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupUMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 270; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupSMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 271; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReadPipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef pointer, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 274; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpWritePipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef pointer, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 275; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReservedReadPipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef reserveId, IdRef index, IdRef pointer, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(reserveId.ToWords()); + tempList.AddRange(index.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 276; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReservedWritePipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef reserveId, IdRef index, IdRef pointer, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(reserveId.ToWords()); + tempList.AddRange(index.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 277; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReserveReadPipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(numPackets.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 278; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReserveWritePipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(numPackets.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 279; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCommitReadPipe(IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(reserveId.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 280; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCommitWritePipe(IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(reserveId.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 281; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIsValidReserveId(IdResultType resultType, IdResult resultId, IdRef reserveId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(reserveId.ToWords()); + ushort opCode = 282; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetNumPipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 283; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetMaxPipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 284; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupReserveReadPipePackets(IdResultType resultType, IdResult resultId, IdScope execution, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(numPackets.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 285; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupReserveWritePipePackets(IdResultType resultType, IdResult resultId, IdScope execution, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(numPackets.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 286; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupCommitReadPipe(IdScope execution, IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(reserveId.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 287; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupCommitWritePipe(IdScope execution, IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(pipe.ToWords()); + tempList.AddRange(reserveId.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 288; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpEnqueueMarker(IdResultType resultType, IdResult resultId, IdRef queue, IdRef numEvents, IdRef waitEvents, IdRef retEvent) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(queue.ToWords()); + tempList.AddRange(numEvents.ToWords()); + tempList.AddRange(waitEvents.ToWords()); + tempList.AddRange(retEvent.ToWords()); + ushort opCode = 291; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpEnqueueKernel(IdResultType resultType, IdResult resultId, IdRef queue, IdRef flags, IdRef nDRange, IdRef numEvents, IdRef waitEvents, IdRef retEvent, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign, params IdRef[] localSize) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(queue.ToWords()); + tempList.AddRange(flags.ToWords()); + tempList.AddRange(nDRange.ToWords()); + tempList.AddRange(numEvents.ToWords()); + tempList.AddRange(waitEvents.ToWords()); + tempList.AddRange(retEvent.ToWords()); + tempList.AddRange(invoke.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(paramSize.ToWords()); + tempList.AddRange(paramAlign.ToWords()); + foreach(var el in localSize) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 292; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetKernelNDrangeSubGroupCount(IdResultType resultType, IdResult resultId, IdRef nDRange, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(nDRange.ToWords()); + tempList.AddRange(invoke.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(paramSize.ToWords()); + tempList.AddRange(paramAlign.ToWords()); + ushort opCode = 293; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetKernelNDrangeMaxSubGroupSize(IdResultType resultType, IdResult resultId, IdRef nDRange, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(nDRange.ToWords()); + tempList.AddRange(invoke.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(paramSize.ToWords()); + tempList.AddRange(paramAlign.ToWords()); + ushort opCode = 294; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetKernelWorkGroupSize(IdResultType resultType, IdResult resultId, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(invoke.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(paramSize.ToWords()); + tempList.AddRange(paramAlign.ToWords()); + ushort opCode = 295; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetKernelPreferredWorkGroupSizeMultiple(IdResultType resultType, IdResult resultId, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(invoke.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(paramSize.ToWords()); + tempList.AddRange(paramAlign.ToWords()); + ushort opCode = 296; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRetainEvent(IdRef @event) + { + var tempList = new List(); + tempList.AddRange(@event.ToWords()); + ushort opCode = 297; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReleaseEvent(IdRef @event) + { + var tempList = new List(); + tempList.AddRange(@event.ToWords()); + ushort opCode = 298; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCreateUserEvent(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 299; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIsValidEvent(IdResultType resultType, IdResult resultId, IdRef @event) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(@event.ToWords()); + ushort opCode = 300; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSetUserEventStatus(IdRef @event, IdRef status) + { + var tempList = new List(); + tempList.AddRange(@event.ToWords()); + tempList.AddRange(status.ToWords()); + ushort opCode = 301; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCaptureEventProfilingInfo(IdRef @event, IdRef profilingInfo, IdRef value) + { + var tempList = new List(); + tempList.AddRange(@event.ToWords()); + tempList.AddRange(profilingInfo.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 302; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetDefaultQueue(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 303; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBuildNDRange(IdResultType resultType, IdResult resultId, IdRef globalWorkSize, IdRef localWorkSize, IdRef globalWorkOffset) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(globalWorkSize.ToWords()); + tempList.AddRange(localWorkSize.ToWords()); + tempList.AddRange(globalWorkOffset.ToWords()); + ushort opCode = 304; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 305; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(param4.ToWords()); + ushort opCode = 306; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 307; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + tempList.AddRange(param5.ToWords()); + ushort opCode = 308; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleProjImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 309; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleProjExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(param4.ToWords()); + ushort opCode = 310; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleProjDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 311; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseSampleProjDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + tempList.AddRange(param5.ToWords()); + ushort opCode = 312; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseFetch(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 313; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef component, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(component.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 314; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseDrefGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(dref.ToWords()); + if(param5 is ImageOperands param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 315; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseTexelsResident(IdResultType resultType, IdResult resultId, IdRef residentCode) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(residentCode.ToWords()); + ushort opCode = 316; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpNoLine() + { + ushort opCode = 317; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpAtomicFlagTestAndSet(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 318; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicFlagClear(IdRef pointer, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 319; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSparseRead(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + if(param4 is ImageOperands param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 320; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSizeOf(IdResultType resultType, IdResult resultId, IdRef pointer) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + ushort opCode = 321; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypePipeStorage(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 322; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantPipeStorage(IdResultType resultType, IdResult resultId, LiteralInteger packetSize, LiteralInteger packetAlignment, LiteralInteger capacity) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + tempList.AddRange(capacity.ToWords()); + ushort opCode = 323; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCreatePipeFromPipeStorage(IdResultType resultType, IdResult resultId, IdRef pipeStorage) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pipeStorage.ToWords()); + ushort opCode = 324; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetKernelLocalSizeForSubgroupCount(IdResultType resultType, IdResult resultId, IdRef subgroupCount, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(subgroupCount.ToWords()); + tempList.AddRange(invoke.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(paramSize.ToWords()); + tempList.AddRange(paramAlign.ToWords()); + ushort opCode = 325; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGetKernelMaxNumSubgroups(IdResultType resultType, IdResult resultId, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(invoke.ToWords()); + tempList.AddRange(param.ToWords()); + tempList.AddRange(paramSize.ToWords()); + tempList.AddRange(paramAlign.ToWords()); + ushort opCode = 326; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeNamedBarrier(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 327; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpNamedBarrierInitialize(IdResultType resultType, IdResult resultId, IdRef subgroupCount) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(subgroupCount.ToWords()); + ushort opCode = 328; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMemoryNamedBarrier(IdRef namedBarrier, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(namedBarrier.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 329; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpModuleProcessed(LiteralString process) + { + var tempList = new List(); + tempList.AddRange(process.ToWords()); + ushort opCode = 330; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExecutionModeId(IdRef entryPoint, ExecutionMode mode) + { + var tempList = new List(); + tempList.AddRange(entryPoint.ToWords()); + tempList.AddRange(mode.ToWords()); + ushort opCode = 331; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDecorateId(IdRef target, Decoration param1) + { + var tempList = new List(); + tempList.AddRange(target.ToWords()); + tempList.AddRange(param1.ToWords()); + ushort opCode = 332; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformElect(IdResultType resultType, IdResult resultId, IdScope execution) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + ushort opCode = 333; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformAll(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 334; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformAny(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 335; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformAllEqual(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 336; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBroadcast(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef id) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(id.ToWords()); + ushort opCode = 337; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBroadcastFirst(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 338; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBallot(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 339; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformInverseBallot(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 340; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBallotBitExtract(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef index) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(index.ToWords()); + ushort opCode = 341; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBallotBitCount(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 342; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBallotFindLSB(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 343; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBallotFindMSB(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 344; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformShuffle(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef id) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(id.ToWords()); + ushort opCode = 345; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformShuffleXor(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef mask) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(mask.ToWords()); + ushort opCode = 346; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformShuffleUp(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef delta) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(delta.ToWords()); + ushort opCode = 347; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformShuffleDown(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef delta) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(delta.ToWords()); + ushort opCode = 348; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformIAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 349; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformFAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 350; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformIMul(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 351; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformFMul(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 352; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformSMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 353; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformUMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 354; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformFMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 355; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformSMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 356; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformUMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 357; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformFMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 358; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBitwiseAnd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 359; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBitwiseOr(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 360; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformBitwiseXor(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 361; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformLogicalAnd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 362; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformLogicalOr(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 363; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformLogicalXor(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(value.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 364; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformQuadBroadcast(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef index) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(index.ToWords()); + ushort opCode = 365; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformQuadSwap(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef direction) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(direction.ToWords()); + ushort opCode = 366; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCopyLogical(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 400; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpPtrEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 401; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpPtrNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 402; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpPtrDiff(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 403; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpColorAttachmentReadEXT(IdResultType resultType, IdResult resultId, IdRef attachment, IdRef? sample = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(attachment.ToWords()); + if(sample is IdRef sampleNotNull) + tempList.AddRange(sampleNotNull.ToWords()); + ushort opCode = 4160; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDepthAttachmentReadEXT(IdResultType resultType, IdResult resultId, IdRef? sample = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + if(sample is IdRef sampleNotNull) + tempList.AddRange(sampleNotNull.ToWords()); + ushort opCode = 4161; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpStencilAttachmentReadEXT(IdResultType resultType, IdResult resultId, IdRef? sample = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + if(sample is IdRef sampleNotNull) + tempList.AddRange(sampleNotNull.ToWords()); + ushort opCode = 4162; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTerminateInvocation() + { + ushort opCode = 4416; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpSubgroupBallotKHR(IdResultType resultType, IdResult resultId, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 4421; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupFirstInvocationKHR(IdResultType resultType, IdResult resultId, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 4422; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAllKHR(IdResultType resultType, IdResult resultId, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 4428; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAnyKHR(IdResultType resultType, IdResult resultId, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 4429; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAllEqualKHR(IdResultType resultType, IdResult resultId, IdRef predicate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(predicate.ToWords()); + ushort opCode = 4430; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformRotateKHR(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef delta, IdRef? clusterSize = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(delta.ToWords()); + if(clusterSize is IdRef clusterSizeNotNull) + tempList.AddRange(clusterSizeNotNull.ToWords()); + ushort opCode = 4431; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupReadInvocationKHR(IdResultType resultType, IdResult resultId, IdRef value, IdRef index) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(index.ToWords()); + ushort opCode = 4432; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTraceRayKHR(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(accel.ToWords()); + tempList.AddRange(rayFlags.ToWords()); + tempList.AddRange(cullMask.ToWords()); + tempList.AddRange(sBTOffset.ToWords()); + tempList.AddRange(sBTStride.ToWords()); + tempList.AddRange(missIndex.ToWords()); + tempList.AddRange(rayOrigin.ToWords()); + tempList.AddRange(rayTmin.ToWords()); + tempList.AddRange(rayDirection.ToWords()); + tempList.AddRange(rayTmax.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 4445; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExecuteCallableKHR(IdRef sBTIndex, IdRef callableData) + { + var tempList = new List(); + tempList.AddRange(sBTIndex.ToWords()); + tempList.AddRange(callableData.ToWords()); + ushort opCode = 4446; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertUToAccelerationStructureKHR(IdResultType resultType, IdResult resultId, IdRef accel) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(accel.ToWords()); + ushort opCode = 4447; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIgnoreIntersectionKHR() + { + ushort opCode = 4448; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpTerminateRayKHR() + { + ushort opCode = 4449; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpSDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4450; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSDotKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4450; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4451; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUDotKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4451; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSUDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4452; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSUDotKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4452; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSDotAccSat(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + tempList.AddRange(accumulator.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4453; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSDotAccSatKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + tempList.AddRange(accumulator.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4453; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUDotAccSat(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + tempList.AddRange(accumulator.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4454; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUDotAccSatKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + tempList.AddRange(accumulator.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4454; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSUDotAccSat(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + tempList.AddRange(accumulator.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4455; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSUDotAccSatKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(vector1.ToWords()); + tempList.AddRange(vector2.ToWords()); + tempList.AddRange(accumulator.ToWords()); + if(packedVectorFormat is PackedVectorFormat packedVectorFormatNotNull) + tempList.AddRange(packedVectorFormatNotNull.ToWords()); + ushort opCode = 4455; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeCooperativeMatrixKHR(IdResult resultId, IdRef componentType, IdScope scope, IdRef rows, IdRef columns, IdRef use) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(componentType.ToWords()); + tempList.AddRange(scope.ToWords()); + tempList.AddRange(rows.ToWords()); + tempList.AddRange(columns.ToWords()); + tempList.AddRange(use.ToWords()); + ushort opCode = 4456; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixLoadKHR(IdResultType resultType, IdResult resultId, IdRef pointer, IdRef memoryLayout, IdRef? stride = null, MemoryAccess? memoryOperand = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memoryLayout.ToWords()); + if(stride is IdRef strideNotNull) + tempList.AddRange(strideNotNull.ToWords()); + if(memoryOperand is MemoryAccess memoryOperandNotNull) + tempList.AddRange(memoryOperandNotNull.ToWords()); + ushort opCode = 4457; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixStoreKHR(IdRef pointer, IdRef @object, IdRef memoryLayout, IdRef? stride = null, MemoryAccess? memoryOperand = null) + { + var tempList = new List(); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(@object.ToWords()); + tempList.AddRange(memoryLayout.ToWords()); + if(stride is IdRef strideNotNull) + tempList.AddRange(strideNotNull.ToWords()); + if(memoryOperand is MemoryAccess memoryOperandNotNull) + tempList.AddRange(memoryOperandNotNull.ToWords()); + ushort opCode = 4458; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixMulAddKHR(IdResultType resultType, IdResult resultId, IdRef a, IdRef b, IdRef c, CooperativeMatrixOperands? cooperativeMatrixOperands = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(c.ToWords()); + if(cooperativeMatrixOperands is CooperativeMatrixOperands cooperativeMatrixOperandsNotNull) + tempList.AddRange(cooperativeMatrixOperandsNotNull.ToWords()); + ushort opCode = 4459; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixLengthKHR(IdResultType resultType, IdResult resultId, IdRef type) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(type.ToWords()); + ushort opCode = 4460; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeRayQueryKHR(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 4472; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryInitializeKHR(IdRef rayQuery, IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef rayOrigin, IdRef rayTMin, IdRef rayDirection, IdRef rayTMax) + { + var tempList = new List(); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(accel.ToWords()); + tempList.AddRange(rayFlags.ToWords()); + tempList.AddRange(cullMask.ToWords()); + tempList.AddRange(rayOrigin.ToWords()); + tempList.AddRange(rayTMin.ToWords()); + tempList.AddRange(rayDirection.ToWords()); + tempList.AddRange(rayTMax.ToWords()); + ushort opCode = 4473; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryTerminateKHR(IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 4474; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGenerateIntersectionKHR(IdRef rayQuery, IdRef hitT) + { + var tempList = new List(); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(hitT.ToWords()); + ushort opCode = 4475; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryConfirmIntersectionKHR(IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 4476; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryProceedKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 4477; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionTypeKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 4479; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleWeightedQCOM(IdResultType resultType, IdResult resultId, IdRef texture, IdRef coordinates, IdRef weights) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(texture.ToWords()); + tempList.AddRange(coordinates.ToWords()); + tempList.AddRange(weights.ToWords()); + ushort opCode = 4480; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageBoxFilterQCOM(IdResultType resultType, IdResult resultId, IdRef texture, IdRef coordinates, IdRef boxSize) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(texture.ToWords()); + tempList.AddRange(coordinates.ToWords()); + tempList.AddRange(boxSize.ToWords()); + ushort opCode = 4481; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageBlockMatchSSDQCOM(IdResultType resultType, IdResult resultId, IdRef target, IdRef targetCoordinates, IdRef reference, IdRef referenceCoordinates, IdRef blockSize) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(target.ToWords()); + tempList.AddRange(targetCoordinates.ToWords()); + tempList.AddRange(reference.ToWords()); + tempList.AddRange(referenceCoordinates.ToWords()); + tempList.AddRange(blockSize.ToWords()); + ushort opCode = 4482; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageBlockMatchSADQCOM(IdResultType resultType, IdResult resultId, IdRef target, IdRef targetCoordinates, IdRef reference, IdRef referenceCoordinates, IdRef blockSize) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(target.ToWords()); + tempList.AddRange(targetCoordinates.ToWords()); + tempList.AddRange(reference.ToWords()); + tempList.AddRange(referenceCoordinates.ToWords()); + tempList.AddRange(blockSize.ToWords()); + ushort opCode = 4483; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupIAddNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5000; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupFAddNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5001; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupFMinNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5002; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupUMinNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5003; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupSMinNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5004; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupFMaxNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5005; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupUMaxNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5006; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupSMaxNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 5007; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFragmentMaskFetchAMD(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + ushort opCode = 5011; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFragmentFetchAMD(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, IdRef fragmentIndex) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(fragmentIndex.ToWords()); + ushort opCode = 5012; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReadClockKHR(IdResultType resultType, IdResult resultId, IdScope scope) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(scope.ToWords()); + ushort opCode = 5056; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFinalizeNodePayloadsAMDX(IdRef payloadArray) + { + var tempList = new List(); + tempList.AddRange(payloadArray.ToWords()); + ushort opCode = 5075; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFinishWritingNodePayloadAMDX(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5078; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpInitializeNodePayloadsAMDX(IdRef payloadArray, IdScope visibility, IdRef payloadCount, IdRef nodeIndex) + { + var tempList = new List(); + tempList.AddRange(payloadArray.ToWords()); + tempList.AddRange(visibility.ToWords()); + tempList.AddRange(payloadCount.ToWords()); + tempList.AddRange(nodeIndex.ToWords()); + ushort opCode = 5090; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectRecordHitMotionNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef currentTime, IdRef hitObjectAttributes) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(accelerationStructure.ToWords()); + tempList.AddRange(instanceId.ToWords()); + tempList.AddRange(primitiveId.ToWords()); + tempList.AddRange(geometryIndex.ToWords()); + tempList.AddRange(hitKind.ToWords()); + tempList.AddRange(sBTRecordOffset.ToWords()); + tempList.AddRange(sBTRecordStride.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + tempList.AddRange(currentTime.ToWords()); + tempList.AddRange(hitObjectAttributes.ToWords()); + ushort opCode = 5249; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectRecordHitWithIndexMotionNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef currentTime, IdRef hitObjectAttributes) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(accelerationStructure.ToWords()); + tempList.AddRange(instanceId.ToWords()); + tempList.AddRange(primitiveId.ToWords()); + tempList.AddRange(geometryIndex.ToWords()); + tempList.AddRange(hitKind.ToWords()); + tempList.AddRange(sBTRecordIndex.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + tempList.AddRange(currentTime.ToWords()); + tempList.AddRange(hitObjectAttributes.ToWords()); + ushort opCode = 5250; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectRecordMissMotionNV(IdRef hitObject, IdRef sBTIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef currentTime) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(sBTIndex.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + tempList.AddRange(currentTime.ToWords()); + ushort opCode = 5251; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetWorldToObjectNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5252; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetObjectToWorldNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5253; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetObjectRayDirectionNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5254; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetObjectRayOriginNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5255; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectTraceRayMotionNV(IdRef hitObject, IdRef accelerationStructure, IdRef rayFlags, IdRef cullmask, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef missIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef time, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(accelerationStructure.ToWords()); + tempList.AddRange(rayFlags.ToWords()); + tempList.AddRange(cullmask.ToWords()); + tempList.AddRange(sBTRecordOffset.ToWords()); + tempList.AddRange(sBTRecordStride.ToWords()); + tempList.AddRange(missIndex.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + tempList.AddRange(time.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5256; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetShaderRecordBufferHandleNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5257; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetShaderBindingTableRecordIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5258; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectRecordEmptyNV(IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5259; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectTraceRayNV(IdRef hitObject, IdRef accelerationStructure, IdRef rayFlags, IdRef cullmask, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef missIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(accelerationStructure.ToWords()); + tempList.AddRange(rayFlags.ToWords()); + tempList.AddRange(cullmask.ToWords()); + tempList.AddRange(sBTRecordOffset.ToWords()); + tempList.AddRange(sBTRecordStride.ToWords()); + tempList.AddRange(missIndex.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5260; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectRecordHitNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef hitObjectAttributes) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(accelerationStructure.ToWords()); + tempList.AddRange(instanceId.ToWords()); + tempList.AddRange(primitiveId.ToWords()); + tempList.AddRange(geometryIndex.ToWords()); + tempList.AddRange(hitKind.ToWords()); + tempList.AddRange(sBTRecordOffset.ToWords()); + tempList.AddRange(sBTRecordStride.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + tempList.AddRange(hitObjectAttributes.ToWords()); + ushort opCode = 5261; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectRecordHitWithIndexNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef hitObjectAttributes) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(accelerationStructure.ToWords()); + tempList.AddRange(instanceId.ToWords()); + tempList.AddRange(primitiveId.ToWords()); + tempList.AddRange(geometryIndex.ToWords()); + tempList.AddRange(hitKind.ToWords()); + tempList.AddRange(sBTRecordIndex.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + tempList.AddRange(hitObjectAttributes.ToWords()); + ushort opCode = 5262; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectRecordMissNV(IdRef hitObject, IdRef sBTIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(sBTIndex.ToWords()); + tempList.AddRange(origin.ToWords()); + tempList.AddRange(tMin.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(tMax.ToWords()); + ushort opCode = 5263; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectExecuteShaderNV(IdRef hitObject, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5264; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetCurrentTimeNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5265; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetAttributesNV(IdRef hitObject, IdRef hitObjectAttribute) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + tempList.AddRange(hitObjectAttribute.ToWords()); + ushort opCode = 5266; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetHitKindNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5267; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetPrimitiveIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5268; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetGeometryIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5269; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetInstanceIdNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5270; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetInstanceCustomIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5271; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetWorldRayDirectionNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5272; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetWorldRayOriginNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5273; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetRayTMaxNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5274; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectGetRayTMinNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5275; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectIsEmptyNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5276; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectIsHitNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5277; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpHitObjectIsMissNV(IdResultType resultType, IdResult resultId, IdRef hitObject) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hitObject.ToWords()); + ushort opCode = 5278; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReorderThreadWithHitObjectNV(IdRef hitObject, IdRef? hint = null, IdRef? bits = null) + { + var tempList = new List(); + tempList.AddRange(hitObject.ToWords()); + if(hint is IdRef hintNotNull) + tempList.AddRange(hintNotNull.ToWords()); + if(bits is IdRef bitsNotNull) + tempList.AddRange(bitsNotNull.ToWords()); + ushort opCode = 5279; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReorderThreadWithHintNV(IdRef hint, IdRef bits) + { + var tempList = new List(); + tempList.AddRange(hint.ToWords()); + tempList.AddRange(bits.ToWords()); + ushort opCode = 5280; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeHitObjectNV(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5281; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpImageSampleFootprintNV(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef granularity, IdRef coarse, ImageOperands? param6 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sampledImage.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(granularity.ToWords()); + tempList.AddRange(coarse.ToWords()); + if(param6 is ImageOperands param6NotNull) + tempList.AddRange(param6NotNull.ToWords()); + ushort opCode = 5283; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpEmitMeshTasksEXT(IdRef groupCountX, IdRef groupCountY, IdRef groupCountZ, IdRef? payload = null) + { + var tempList = new List(); + tempList.AddRange(groupCountX.ToWords()); + tempList.AddRange(groupCountY.ToWords()); + tempList.AddRange(groupCountZ.ToWords()); + if(payload is IdRef payloadNotNull) + tempList.AddRange(payloadNotNull.ToWords()); + ushort opCode = 5294; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSetMeshOutputsEXT(IdRef vertexCount, IdRef primitiveCount) + { + var tempList = new List(); + tempList.AddRange(vertexCount.ToWords()); + tempList.AddRange(primitiveCount.ToWords()); + ushort opCode = 5295; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupNonUniformPartitionNV(IdResultType resultType, IdResult resultId, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 5296; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpWritePackedPrimitiveIndices4x8NV(IdRef indexOffset, IdRef packedIndices) + { + var tempList = new List(); + tempList.AddRange(indexOffset.ToWords()); + tempList.AddRange(packedIndices.ToWords()); + ushort opCode = 5299; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReportIntersectionNV(IdResultType resultType, IdResult resultId, IdRef hit, IdRef hitKind) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hit.ToWords()); + tempList.AddRange(hitKind.ToWords()); + ushort opCode = 5334; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReportIntersectionKHR(IdResultType resultType, IdResult resultId, IdRef hit, IdRef hitKind) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(hit.ToWords()); + tempList.AddRange(hitKind.ToWords()); + ushort opCode = 5334; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIgnoreIntersectionNV() + { + ushort opCode = 5335; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpTerminateRayNV() + { + ushort opCode = 5336; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpTraceNV(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef payloadId) + { + var tempList = new List(); + tempList.AddRange(accel.ToWords()); + tempList.AddRange(rayFlags.ToWords()); + tempList.AddRange(cullMask.ToWords()); + tempList.AddRange(sBTOffset.ToWords()); + tempList.AddRange(sBTStride.ToWords()); + tempList.AddRange(missIndex.ToWords()); + tempList.AddRange(rayOrigin.ToWords()); + tempList.AddRange(rayTmin.ToWords()); + tempList.AddRange(rayDirection.ToWords()); + tempList.AddRange(rayTmax.ToWords()); + tempList.AddRange(payloadId.ToWords()); + ushort opCode = 5337; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTraceMotionNV(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef time, IdRef payloadId) + { + var tempList = new List(); + tempList.AddRange(accel.ToWords()); + tempList.AddRange(rayFlags.ToWords()); + tempList.AddRange(cullMask.ToWords()); + tempList.AddRange(sBTOffset.ToWords()); + tempList.AddRange(sBTStride.ToWords()); + tempList.AddRange(missIndex.ToWords()); + tempList.AddRange(rayOrigin.ToWords()); + tempList.AddRange(rayTmin.ToWords()); + tempList.AddRange(rayDirection.ToWords()); + tempList.AddRange(rayTmax.ToWords()); + tempList.AddRange(time.ToWords()); + tempList.AddRange(payloadId.ToWords()); + ushort opCode = 5338; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTraceRayMotionNV(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef time, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(accel.ToWords()); + tempList.AddRange(rayFlags.ToWords()); + tempList.AddRange(cullMask.ToWords()); + tempList.AddRange(sBTOffset.ToWords()); + tempList.AddRange(sBTStride.ToWords()); + tempList.AddRange(missIndex.ToWords()); + tempList.AddRange(rayOrigin.ToWords()); + tempList.AddRange(rayTmin.ToWords()); + tempList.AddRange(rayDirection.ToWords()); + tempList.AddRange(rayTmax.ToWords()); + tempList.AddRange(time.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5339; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionTriangleVertexPositionsKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 5340; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAccelerationStructureNV(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5341; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAccelerationStructureKHR(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5341; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExecuteCallableNV(IdRef sBTIndex, IdRef callableDataId) + { + var tempList = new List(); + tempList.AddRange(sBTIndex.ToWords()); + tempList.AddRange(callableDataId.ToWords()); + ushort opCode = 5344; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeCooperativeMatrixNV(IdResult resultId, IdRef componentType, IdScope execution, IdRef rows, IdRef columns) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(componentType.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(rows.ToWords()); + tempList.AddRange(columns.ToWords()); + ushort opCode = 5358; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixLoadNV(IdResultType resultType, IdResult resultId, IdRef pointer, IdRef stride, IdRef columnMajor, MemoryAccess? param5 = null) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(stride.ToWords()); + tempList.AddRange(columnMajor.ToWords()); + if(param5 is MemoryAccess param5NotNull) + tempList.AddRange(param5NotNull.ToWords()); + ushort opCode = 5359; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixStoreNV(IdRef pointer, IdRef @object, IdRef stride, IdRef columnMajor, MemoryAccess? param4 = null) + { + var tempList = new List(); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(@object.ToWords()); + tempList.AddRange(stride.ToWords()); + tempList.AddRange(columnMajor.ToWords()); + if(param4 is MemoryAccess param4NotNull) + tempList.AddRange(param4NotNull.ToWords()); + ushort opCode = 5360; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixMulAddNV(IdResultType resultType, IdResult resultId, IdRef a, IdRef b, IdRef c) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(c.ToWords()); + ushort opCode = 5361; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCooperativeMatrixLengthNV(IdResultType resultType, IdResult resultId, IdRef type) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(type.ToWords()); + ushort opCode = 5362; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpBeginInvocationInterlockEXT() + { + ushort opCode = 5364; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpEndInvocationInterlockEXT() + { + ushort opCode = 5365; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpDemoteToHelperInvocation() + { + ushort opCode = 5380; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpDemoteToHelperInvocationEXT() + { + ushort opCode = 5380; + ushort wordCount = 0; + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + } + + public void GenerateOpIsHelperInvocationEXT(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5381; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertUToImageNV(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5391; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertUToSamplerNV(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5392; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertImageToUNV(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5393; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertSamplerToUNV(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5394; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertUToSampledImageNV(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5395; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertSampledImageToUNV(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5396; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSamplerImageAddressingModeNV(LiteralInteger bitWidth) + { + var tempList = new List(); + tempList.AddRange(bitWidth.ToWords()); + ushort opCode = 5397; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupShuffleINTEL(IdResultType resultType, IdResult resultId, IdRef data, IdRef invocationId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(data.ToWords()); + tempList.AddRange(invocationId.ToWords()); + ushort opCode = 5571; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupShuffleDownINTEL(IdResultType resultType, IdResult resultId, IdRef current, IdRef next, IdRef delta) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(current.ToWords()); + tempList.AddRange(next.ToWords()); + tempList.AddRange(delta.ToWords()); + ushort opCode = 5572; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupShuffleUpINTEL(IdResultType resultType, IdResult resultId, IdRef previous, IdRef current, IdRef delta) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(previous.ToWords()); + tempList.AddRange(current.ToWords()); + tempList.AddRange(delta.ToWords()); + ushort opCode = 5573; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupShuffleXorINTEL(IdResultType resultType, IdResult resultId, IdRef data, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(data.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 5574; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupBlockReadINTEL(IdResultType resultType, IdResult resultId, IdRef ptr) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(ptr.ToWords()); + ushort opCode = 5575; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupBlockWriteINTEL(IdRef ptr, IdRef data) + { + var tempList = new List(); + tempList.AddRange(ptr.ToWords()); + tempList.AddRange(data.ToWords()); + ushort opCode = 5576; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupImageBlockReadINTEL(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + ushort opCode = 5577; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupImageBlockWriteINTEL(IdRef image, IdRef coordinate, IdRef data) + { + var tempList = new List(); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(data.ToWords()); + ushort opCode = 5578; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupImageMediaBlockReadINTEL(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, IdRef width, IdRef height) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(width.ToWords()); + tempList.AddRange(height.ToWords()); + ushort opCode = 5580; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupImageMediaBlockWriteINTEL(IdRef image, IdRef coordinate, IdRef width, IdRef height, IdRef data) + { + var tempList = new List(); + tempList.AddRange(image.ToWords()); + tempList.AddRange(coordinate.ToWords()); + tempList.AddRange(width.ToWords()); + tempList.AddRange(height.ToWords()); + tempList.AddRange(data.ToWords()); + ushort opCode = 5581; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUCountLeadingZerosINTEL(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5585; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUCountTrailingZerosINTEL(IdResultType resultType, IdResult resultId, IdRef operand) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand.ToWords()); + ushort opCode = 5586; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAbsISubINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5587; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAbsUSubINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5588; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIAddSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5589; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUAddSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5590; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIAverageINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5591; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUAverageINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5592; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIAverageRoundedINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5593; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUAverageRoundedINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5594; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpISubSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5595; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUSubSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5596; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpIMul32x16INTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5597; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpUMul32x16INTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(operand1.ToWords()); + tempList.AddRange(operand2.ToWords()); + ushort opCode = 5598; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantFunctionPointerINTEL(IdResultType resultType, IdResult resultId, IdRef function) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(function.ToWords()); + ushort opCode = 5600; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFunctionPointerCallINTEL(IdResultType resultType, IdResult resultId, params IdRef[] operand1) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + foreach(var el in operand1) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 5601; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAsmTargetINTEL(IdResultType resultType, IdResult resultId, LiteralString asmtarget) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(asmtarget.ToWords()); + ushort opCode = 5609; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAsmINTEL(IdResultType resultType, IdResult resultId, IdRef asmtype, IdRef target, LiteralString asminstructions, LiteralString constraints) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(asmtype.ToWords()); + tempList.AddRange(target.ToWords()); + tempList.AddRange(asminstructions.ToWords()); + tempList.AddRange(constraints.ToWords()); + ushort opCode = 5610; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAsmCallINTEL(IdResultType resultType, IdResult resultId, IdRef asm, params IdRef[] argument0) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(asm.ToWords()); + foreach(var el in argument0) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 5611; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicFMinEXT(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 5614; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicFMaxEXT(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 5615; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAssumeTrueKHR(IdRef condition) + { + var tempList = new List(); + tempList.AddRange(condition.ToWords()); + ushort opCode = 5630; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpExpectKHR(IdResultType resultType, IdResult resultId, IdRef value, IdRef expectedValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(value.ToWords()); + tempList.AddRange(expectedValue.ToWords()); + ushort opCode = 5631; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDecorateString(IdRef target, Decoration param1) + { + var tempList = new List(); + tempList.AddRange(target.ToWords()); + tempList.AddRange(param1.ToWords()); + ushort opCode = 5632; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpDecorateStringGOOGLE(IdRef target, Decoration param1) + { + var tempList = new List(); + tempList.AddRange(target.ToWords()); + tempList.AddRange(param1.ToWords()); + ushort opCode = 5632; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMemberDecorateString(IdRef structType, LiteralInteger member, Decoration param2) + { + var tempList = new List(); + tempList.AddRange(structType.ToWords()); + tempList.AddRange(member.ToWords()); + tempList.AddRange(param2.ToWords()); + ushort opCode = 5633; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpMemberDecorateStringGOOGLE(IdRef structType, LiteralInteger member, Decoration param2) + { + var tempList = new List(); + tempList.AddRange(structType.ToWords()); + tempList.AddRange(member.ToWords()); + tempList.AddRange(param2.ToWords()); + ushort opCode = 5633; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVmeImageINTEL(IdResultType resultType, IdResult resultId, IdRef imageType, IdRef sampler) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(imageType.ToWords()); + tempList.AddRange(sampler.ToWords()); + ushort opCode = 5699; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeVmeImageINTEL(IdResult resultId, IdRef imageType) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(imageType.ToWords()); + ushort opCode = 5700; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcImePayloadINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5701; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcRefPayloadINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5702; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcSicPayloadINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5703; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcMcePayloadINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5704; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcMceResultINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5705; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcImeResultINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5706; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcImeResultSingleReferenceStreamoutINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5707; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcImeResultDualReferenceStreamoutINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5708; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcImeSingleReferenceStreaminINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5709; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcImeDualReferenceStreaminINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5710; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcRefResultINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5711; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeAvcSicResultINTEL(IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5712; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sliceType.ToWords()); + tempList.AddRange(qp.ToWords()); + ushort opCode = 5713; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef referenceBasePenalty, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(referenceBasePenalty.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5714; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sliceType.ToWords()); + tempList.AddRange(qp.ToWords()); + ushort opCode = 5715; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetInterShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef packedShapePenalty, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packedShapePenalty.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5716; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sliceType.ToWords()); + tempList.AddRange(qp.ToWords()); + ushort opCode = 5717; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetInterDirectionPenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef directionCost, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(directionCost.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5718; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sliceType.ToWords()); + tempList.AddRange(qp.ToWords()); + ushort opCode = 5719; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sliceType.ToWords()); + tempList.AddRange(qp.ToWords()); + ushort opCode = 5720; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5721; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5722; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5723; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL(IdResultType resultType, IdResult resultId, IdRef packedCostCenterDelta, IdRef packedCostTable, IdRef costPrecision, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packedCostCenterDelta.ToWords()); + tempList.AddRange(packedCostTable.ToWords()); + tempList.AddRange(costPrecision.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5724; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sliceType.ToWords()); + tempList.AddRange(qp.ToWords()); + ushort opCode = 5725; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5726; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5727; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetAcOnlyHaarINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5728; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL(IdResultType resultType, IdResult resultId, IdRef sourceFieldPolarity, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(sourceFieldPolarity.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5729; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL(IdResultType resultType, IdResult resultId, IdRef referenceFieldPolarity, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(referenceFieldPolarity.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5730; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL(IdResultType resultType, IdResult resultId, IdRef forwardReferenceFieldPolarity, IdRef backwardReferenceFieldPolarity, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(forwardReferenceFieldPolarity.ToWords()); + tempList.AddRange(backwardReferenceFieldPolarity.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5731; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceConvertToImePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5732; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceConvertToImeResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5733; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceConvertToRefPayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5734; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceConvertToRefResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5735; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceConvertToSicPayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5736; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceConvertToSicResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5737; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetMotionVectorsINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5738; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetInterDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5739; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetBestInterDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5740; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetInterMajorShapeINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5741; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetInterMinorShapeINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5742; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetInterDirectionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5743; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetInterMotionVectorCountINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5744; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetInterReferenceIdsINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5745; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL(IdResultType resultType, IdResult resultId, IdRef packedReferenceIds, IdRef packedReferenceParameterFieldPolarities, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packedReferenceIds.ToWords()); + tempList.AddRange(packedReferenceParameterFieldPolarities.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5746; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord, IdRef partitionMask, IdRef sADAdjustment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcCoord.ToWords()); + tempList.AddRange(partitionMask.ToWords()); + tempList.AddRange(sADAdjustment.ToWords()); + ushort opCode = 5747; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeSetSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef refOffset, IdRef searchWindowConfig, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(refOffset.ToWords()); + tempList.AddRange(searchWindowConfig.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5748; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeSetDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef fwdRefOffset, IdRef bwdRefOffset, IdRef idSearchWindowConfig, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(fwdRefOffset.ToWords()); + tempList.AddRange(bwdRefOffset.ToWords()); + tempList.AddRange(idSearchWindowConfig.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5749; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeRefWindowSizeINTEL(IdResultType resultType, IdResult resultId, IdRef searchWindowConfig, IdRef dualRef) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(searchWindowConfig.ToWords()); + tempList.AddRange(dualRef.ToWords()); + ushort opCode = 5750; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeAdjustRefOffsetINTEL(IdResultType resultType, IdResult resultId, IdRef refOffset, IdRef srcCoord, IdRef refWindowSize, IdRef imageSize) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(refOffset.ToWords()); + tempList.AddRange(srcCoord.ToWords()); + tempList.AddRange(refWindowSize.ToWords()); + tempList.AddRange(imageSize.ToWords()); + ushort opCode = 5751; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeConvertToMcePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5752; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeSetMaxMotionVectorCountINTEL(IdResultType resultType, IdResult resultId, IdRef maxMotionVectorCount, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(maxMotionVectorCount.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5753; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5754; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL(IdResultType resultType, IdResult resultId, IdRef threshold, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(threshold.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5755; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeSetWeightedSadINTEL(IdResultType resultType, IdResult resultId, IdRef packedSadWeights, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packedSadWeights.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5756; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(refImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5757; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(fwdRefImage.ToWords()); + tempList.AddRange(bwdRefImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5758; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload, IdRef streaminComponents) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(refImage.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(streaminComponents.ToWords()); + ushort opCode = 5759; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload, IdRef streaminComponents) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(fwdRefImage.ToWords()); + tempList.AddRange(bwdRefImage.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(streaminComponents.ToWords()); + ushort opCode = 5760; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(refImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5761; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(fwdRefImage.ToWords()); + tempList.AddRange(bwdRefImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5762; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload, IdRef streaminComponents) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(refImage.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(streaminComponents.ToWords()); + ushort opCode = 5763; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload, IdRef streaminComponents) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(fwdRefImage.ToWords()); + tempList.AddRange(bwdRefImage.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(streaminComponents.ToWords()); + ushort opCode = 5764; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeConvertToMceResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5765; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetSingleReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5766; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetDualReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5767; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5768; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeStripDualReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5769; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(majorShape.ToWords()); + ushort opCode = 5770; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(majorShape.ToWords()); + ushort opCode = 5771; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(majorShape.ToWords()); + ushort opCode = 5772; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape, IdRef direction) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(majorShape.ToWords()); + tempList.AddRange(direction.ToWords()); + ushort opCode = 5773; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape, IdRef direction) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(majorShape.ToWords()); + tempList.AddRange(direction.ToWords()); + ushort opCode = 5774; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape, IdRef direction) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + tempList.AddRange(majorShape.ToWords()); + tempList.AddRange(direction.ToWords()); + ushort opCode = 5775; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetBorderReachedINTEL(IdResultType resultType, IdResult resultId, IdRef imageSelect, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(imageSelect.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5776; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5777; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5778; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5779; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5780; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcFmeInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord, IdRef motionVectors, IdRef majorShapes, IdRef minorShapes, IdRef direction, IdRef pixelResolution, IdRef sadAdjustment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcCoord.ToWords()); + tempList.AddRange(motionVectors.ToWords()); + tempList.AddRange(majorShapes.ToWords()); + tempList.AddRange(minorShapes.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(pixelResolution.ToWords()); + tempList.AddRange(sadAdjustment.ToWords()); + ushort opCode = 5781; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcBmeInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord, IdRef motionVectors, IdRef majorShapes, IdRef minorShapes, IdRef direction, IdRef pixelResolution, IdRef bidirectionalWeight, IdRef sadAdjustment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcCoord.ToWords()); + tempList.AddRange(motionVectors.ToWords()); + tempList.AddRange(majorShapes.ToWords()); + tempList.AddRange(minorShapes.ToWords()); + tempList.AddRange(direction.ToWords()); + tempList.AddRange(pixelResolution.ToWords()); + tempList.AddRange(bidirectionalWeight.ToWords()); + tempList.AddRange(sadAdjustment.ToWords()); + ushort opCode = 5782; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefConvertToMcePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5783; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefSetBidirectionalMixDisableINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5784; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefSetBilinearFilterEnableINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5785; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(refImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5786; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefEvaluateWithDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(fwdRefImage.ToWords()); + tempList.AddRange(bwdRefImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5787; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(packedReferenceIds.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5788; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef packedReferenceFieldPolarities, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(packedReferenceIds.ToWords()); + tempList.AddRange(packedReferenceFieldPolarities.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5789; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcRefConvertToMceResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5790; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcCoord.ToWords()); + ushort opCode = 5791; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicConfigureSkcINTEL(IdResultType resultType, IdResult resultId, IdRef skipBlockPartitionType, IdRef skipMotionVectorMask, IdRef motionVectors, IdRef bidirectionalWeight, IdRef sadAdjustment, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(skipBlockPartitionType.ToWords()); + tempList.AddRange(skipMotionVectorMask.ToWords()); + tempList.AddRange(motionVectors.ToWords()); + tempList.AddRange(bidirectionalWeight.ToWords()); + tempList.AddRange(sadAdjustment.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5792; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicConfigureIpeLumaINTEL(IdResultType resultType, IdResult resultId, IdRef lumaIntraPartitionMask, IdRef intraNeighbourAvailabilty, IdRef leftEdgeLumaPixels, IdRef upperLeftCornerLumaPixel, IdRef upperEdgeLumaPixels, IdRef upperRightEdgeLumaPixels, IdRef sadAdjustment, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(lumaIntraPartitionMask.ToWords()); + tempList.AddRange(intraNeighbourAvailabilty.ToWords()); + tempList.AddRange(leftEdgeLumaPixels.ToWords()); + tempList.AddRange(upperLeftCornerLumaPixel.ToWords()); + tempList.AddRange(upperEdgeLumaPixels.ToWords()); + tempList.AddRange(upperRightEdgeLumaPixels.ToWords()); + tempList.AddRange(sadAdjustment.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5793; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicConfigureIpeLumaChromaINTEL(IdResultType resultType, IdResult resultId, IdRef lumaIntraPartitionMask, IdRef intraNeighbourAvailabilty, IdRef leftEdgeLumaPixels, IdRef upperLeftCornerLumaPixel, IdRef upperEdgeLumaPixels, IdRef upperRightEdgeLumaPixels, IdRef leftEdgeChromaPixels, IdRef upperLeftCornerChromaPixel, IdRef upperEdgeChromaPixels, IdRef sadAdjustment, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(lumaIntraPartitionMask.ToWords()); + tempList.AddRange(intraNeighbourAvailabilty.ToWords()); + tempList.AddRange(leftEdgeLumaPixels.ToWords()); + tempList.AddRange(upperLeftCornerLumaPixel.ToWords()); + tempList.AddRange(upperEdgeLumaPixels.ToWords()); + tempList.AddRange(upperRightEdgeLumaPixels.ToWords()); + tempList.AddRange(leftEdgeChromaPixels.ToWords()); + tempList.AddRange(upperLeftCornerChromaPixel.ToWords()); + tempList.AddRange(upperEdgeChromaPixels.ToWords()); + tempList.AddRange(sadAdjustment.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5794; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetMotionVectorMaskINTEL(IdResultType resultType, IdResult resultId, IdRef skipBlockPartitionType, IdRef direction) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(skipBlockPartitionType.ToWords()); + tempList.AddRange(direction.ToWords()); + ushort opCode = 5795; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicConvertToMcePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5796; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef packedShapePenalty, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packedShapePenalty.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5797; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL(IdResultType resultType, IdResult resultId, IdRef lumaModePenalty, IdRef lumaPackedNeighborModes, IdRef lumaPackedNonDcPenalty, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(lumaModePenalty.ToWords()); + tempList.AddRange(lumaPackedNeighborModes.ToWords()); + tempList.AddRange(lumaPackedNonDcPenalty.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5798; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL(IdResultType resultType, IdResult resultId, IdRef chromaModeBasePenalty, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(chromaModeBasePenalty.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5799; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicSetBilinearFilterEnableINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5800; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL(IdResultType resultType, IdResult resultId, IdRef packedSadCoefficients, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packedSadCoefficients.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5801; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL(IdResultType resultType, IdResult resultId, IdRef blockBasedSkipType, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(blockBasedSkipType.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5802; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicEvaluateIpeINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5803; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(refImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5804; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicEvaluateWithDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(fwdRefImage.ToWords()); + tempList.AddRange(bwdRefImage.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5805; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(packedReferenceIds.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5806; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef packedReferenceFieldPolarities, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(srcImage.ToWords()); + tempList.AddRange(packedReferenceIds.ToWords()); + tempList.AddRange(packedReferenceFieldPolarities.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5807; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicConvertToMceResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5808; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetIpeLumaShapeINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5809; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5810; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5811; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetPackedIpeLumaModesINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5812; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetIpeChromaModeINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5813; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5814; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5815; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSubgroupAvcSicGetInterRawSadsINTEL(IdResultType resultType, IdResult resultId, IdRef payload) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(payload.ToWords()); + ushort opCode = 5816; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpVariableLengthArrayINTEL(IdResultType resultType, IdResult resultId, IdRef lenght) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(lenght.ToWords()); + ushort opCode = 5818; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSaveMemoryINTEL(IdResultType resultType, IdResult resultId) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + ushort opCode = 5819; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRestoreMemoryINTEL(IdRef ptr) + { + var tempList = new List(); + tempList.AddRange(ptr.ToWords()); + ushort opCode = 5820; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatSinCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger fromSign, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(fromSign.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5840; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatCastINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5841; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatCastFromIntINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger mout, LiteralInteger fromSign, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(fromSign.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5842; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatCastToIntINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5843; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatAddINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5846; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatSubINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5847; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatMulINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5848; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatDivINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5849; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatGTINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + ushort opCode = 5850; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatGEINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + ushort opCode = 5851; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatLTINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + ushort opCode = 5852; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatLEINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + ushort opCode = 5853; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatEQINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + ushort opCode = 5854; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatRecipINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5855; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatRSqrtINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5856; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatCbrtINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5857; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatHypotINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5858; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatSqrtINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5859; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatLogINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5860; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatLog2INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5861; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatLog10INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5862; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatLog1pINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5863; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatExpINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5864; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatExp2INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5865; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatExp10INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5866; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatExpm1INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5867; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatSinINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5868; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatCosINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5869; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatSinCosINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5870; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatSinPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5871; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5872; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatASinINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5873; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatASinPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5874; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatACosINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5875; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatACosPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5876; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatATanINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5877; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatATanPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5878; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatATan2INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5879; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatPowINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5880; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatPowRINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(m2.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5881; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpArbitraryFloatPowNINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(a.ToWords()); + tempList.AddRange(m1.ToWords()); + tempList.AddRange(b.ToWords()); + tempList.AddRange(mout.ToWords()); + tempList.AddRange(enableSubnormals.ToWords()); + tempList.AddRange(roundingMode.ToWords()); + tempList.AddRange(roundingAccuracy.ToWords()); + ushort opCode = 5882; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpLoopControlINTEL(params LiteralInteger[] loopControlParameters) + { + var tempList = new List(); + foreach(var el in loopControlParameters) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 5887; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAliasDomainDeclINTEL(IdResult resultId, IdRef? name = null) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + if(name is IdRef nameNotNull) + tempList.AddRange(nameNotNull.ToWords()); + ushort opCode = 5911; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAliasScopeDeclINTEL(IdResult resultId, IdRef aliasDomain, IdRef? name = null) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(aliasDomain.ToWords()); + if(name is IdRef nameNotNull) + tempList.AddRange(nameNotNull.ToWords()); + ushort opCode = 5912; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAliasScopeListDeclINTEL(IdResult resultId, params IdRef[] aliasScope1AliasScope2) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + foreach(var el in aliasScope1AliasScope2) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 5913; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedSqrtINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5923; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedRecipINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5924; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedRsqrtINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5925; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedSinINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5926; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedCosINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5927; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedSinCosINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5928; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedSinPiINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5929; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5930; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedSinCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5931; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedLogINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5932; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFixedExpINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(inputType.ToWords()); + tempList.AddRange(input.ToWords()); + tempList.AddRange(s.ToWords()); + tempList.AddRange(i.ToWords()); + tempList.AddRange(rI.ToWords()); + tempList.AddRange(q.ToWords()); + tempList.AddRange(o.ToWords()); + ushort opCode = 5933; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpPtrCastToCrossWorkgroupINTEL(IdResultType resultType, IdResult resultId, IdRef pointer) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + ushort opCode = 5934; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpCrossWorkgroupCastToPtrINTEL(IdResultType resultType, IdResult resultId, IdRef pointer) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + ushort opCode = 5938; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpReadPipeBlockingINTEL(IdResultType resultType, IdResult resultId, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 5946; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpWritePipeBlockingINTEL(IdResultType resultType, IdResult resultId, IdRef packetSize, IdRef packetAlignment) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(packetSize.ToWords()); + tempList.AddRange(packetAlignment.ToWords()); + ushort opCode = 5947; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpFPGARegINTEL(IdResultType resultType, IdResult resultId, IdRef result, IdRef input) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(result.ToWords()); + tempList.AddRange(input.ToWords()); + ushort opCode = 5949; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetRayTMinKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 6016; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetRayFlagsKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 6017; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionTKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6018; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionInstanceCustomIndexKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6019; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionInstanceIdKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6020; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6021; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionGeometryIndexKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6022; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionPrimitiveIndexKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6023; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionBarycentricsKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6024; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionFrontFaceKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6025; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionCandidateAABBOpaqueKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 6026; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionObjectRayDirectionKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6027; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionObjectRayOriginKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6028; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetWorldRayDirectionKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 6029; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetWorldRayOriginKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + ushort opCode = 6030; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionObjectToWorldKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6031; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpRayQueryGetIntersectionWorldToObjectKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(rayQuery.ToWords()); + tempList.AddRange(intersection.ToWords()); + ushort opCode = 6032; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpAtomicFAddEXT(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(pointer.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + tempList.AddRange(value.ToWords()); + ushort opCode = 6035; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeBufferSurfaceINTEL(IdResult resultId, AccessQualifier accessQualifier) + { + var tempList = new List(); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(accessQualifier.ToWords()); + ushort opCode = 6086; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpTypeStructContinuedINTEL(params IdRef[] member0typemember1type) + { + var tempList = new List(); + foreach(var el in member0typemember1type) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 6090; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConstantCompositeContinuedINTEL(params IdRef[] constituents) + { + var tempList = new List(); + foreach(var el in constituents) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 6091; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpSpecConstantCompositeContinuedINTEL(params IdRef[] constituents) + { + var tempList = new List(); + foreach(var el in constituents) + { + tempList.AddRange(el.ToWords()); + } + ushort opCode = 6092; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertFToBF16INTEL(IdResultType resultType, IdResult resultId, IdRef floatValue) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(floatValue.ToWords()); + ushort opCode = 6116; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpConvertBF16ToFINTEL(IdResultType resultType, IdResult resultId, IdRef bFloat16Value) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(bFloat16Value.ToWords()); + ushort opCode = 6117; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpControlBarrierArriveINTEL(IdScope execution, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 6142; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpControlBarrierWaitINTEL(IdScope execution, IdScope memory, IdMemorySemantics semantics) + { + var tempList = new List(); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(memory.ToWords()); + tempList.AddRange(semantics.ToWords()); + ushort opCode = 6143; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupIMulKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6401; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupFMulKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6402; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupBitwiseAndKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6403; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupBitwiseOrKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6404; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupBitwiseXorKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6405; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupLogicalAndKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6406; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupLogicalOrKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6407; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + public void GenerateOpGroupLogicalXorKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x) + { + var tempList = new List(); + tempList.AddRange(resultType.ToWords()); + tempList.AddRange(resultId.ToWords()); + tempList.AddRange(execution.ToWords()); + tempList.AddRange(operation.ToWords()); + tempList.AddRange(x.ToWords()); + ushort opCode = 6408; + ushort wordCount = (ushort) (tempList.Count + 1); + uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount); + _instructions.Add(new SPIRVWord(combined)); + _instructions.AddRange(tempList); + } + + } +} + +#nullable restore diff --git a/Src/ILGPU/Backends/SPIRV/ISPIRVBuilder.cs b/Src/ILGPU/Backends/SPIRV/ISPIRVBuilder.cs new file mode 100644 index 000000000..51a0bdb4a --- /dev/null +++ b/Src/ILGPU/Backends/SPIRV/ISPIRVBuilder.cs @@ -0,0 +1,1483 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: ISPIRVBuilder.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using System; +using ILGPU.Backends.SPIRV.Types; + +// disable: max_line_length + +#nullable enable + +namespace ILGPU.Backends.SPIRV +{ + + internal interface ISPIRVBuilder + { + byte[] ToByteArray(); + + void AddMetadata( + SPIRVWord magic, + SPIRVWord version, + SPIRVWord genMagic, + SPIRVWord bound, + SPIRVWord schema); + + // This is the best way I could come up with to + // handle trying to merge different builders + // Implementing classes will kinda just have to + // deal with it + void Merge(ISPIRVBuilder other); + public void GenerateOpNop(); + + public void GenerateOpUndef(IdResultType resultType, IdResult resultId); + + public void GenerateOpSourceContinued(LiteralString continuedSource); + + public void GenerateOpSource(SourceLanguage param0, LiteralInteger version, IdRef? file = null, LiteralString? source = null); + + public void GenerateOpSourceExtension(LiteralString extension); + + public void GenerateOpName(IdRef target, LiteralString name); + + public void GenerateOpMemberName(IdRef type, LiteralInteger member, LiteralString name); + + public void GenerateOpString(IdResult resultId, LiteralString @string); + + public void GenerateOpLine(IdRef file, LiteralInteger line, LiteralInteger column); + + public void GenerateOpExtension(LiteralString name); + + public void GenerateOpExtInstImport(IdResult resultId, LiteralString name); + + public void GenerateOpExtInst(IdResultType resultType, IdResult resultId, IdRef set, LiteralExtInstInteger instruction, params IdRef[] operand1Operand2); + + public void GenerateOpMemoryModel(AddressingModel param0, MemoryModel param1); + + public void GenerateOpEntryPoint(ExecutionModel param0, IdRef entryPoint, LiteralString name, params IdRef[] @interface); + + public void GenerateOpExecutionMode(IdRef entryPoint, ExecutionMode mode); + + public void GenerateOpCapability(Capability capability); + + public void GenerateOpTypeVoid(IdResult resultId); + + public void GenerateOpTypeBool(IdResult resultId); + + public void GenerateOpTypeInt(IdResult resultId, LiteralInteger width, LiteralInteger signedness); + + public void GenerateOpTypeFloat(IdResult resultId, LiteralInteger width); + + public void GenerateOpTypeVector(IdResult resultId, IdRef componentType, LiteralInteger componentCount); + + public void GenerateOpTypeMatrix(IdResult resultId, IdRef columnType, LiteralInteger columnCount); + + public void GenerateOpTypeImage(IdResult resultId, IdRef sampledType, Dim param2, LiteralInteger depth, LiteralInteger arrayed, LiteralInteger mS, LiteralInteger sampled, ImageFormat param7, AccessQualifier? param8 = null); + + public void GenerateOpTypeSampler(IdResult resultId); + + public void GenerateOpTypeSampledImage(IdResult resultId, IdRef imageType); + + public void GenerateOpTypeArray(IdResult resultId, IdRef elementType, IdRef length); + + public void GenerateOpTypeRuntimeArray(IdResult resultId, IdRef elementType); + + public void GenerateOpTypeStruct(IdResult resultId, params IdRef[] member0typemember1type); + + public void GenerateOpTypeOpaque(IdResult resultId, LiteralString thenameoftheopaquetype); + + public void GenerateOpTypePointer(IdResult resultId, StorageClass param1, IdRef type); + + public void GenerateOpTypeFunction(IdResult resultId, IdRef returnType, params IdRef[] parameter0TypeParameter1Type); + + public void GenerateOpTypeEvent(IdResult resultId); + + public void GenerateOpTypeDeviceEvent(IdResult resultId); + + public void GenerateOpTypeReserveId(IdResult resultId); + + public void GenerateOpTypeQueue(IdResult resultId); + + public void GenerateOpTypePipe(IdResult resultId, AccessQualifier qualifier); + + public void GenerateOpTypeForwardPointer(IdRef pointerType, StorageClass param1); + + public void GenerateOpConstantTrue(IdResultType resultType, IdResult resultId); + + public void GenerateOpConstantFalse(IdResultType resultType, IdResult resultId); + + public void GenerateOpConstant(IdResultType resultType, IdResult resultId, LiteralContextDependentNumber value); + + public void GenerateOpConstantComposite(IdResultType resultType, IdResult resultId, params IdRef[] constituents); + + public void GenerateOpConstantSampler(IdResultType resultType, IdResult resultId, SamplerAddressingMode param2, LiteralInteger param, SamplerFilterMode param4); + + public void GenerateOpConstantNull(IdResultType resultType, IdResult resultId); + + public void GenerateOpSpecConstantTrue(IdResultType resultType, IdResult resultId); + + public void GenerateOpSpecConstantFalse(IdResultType resultType, IdResult resultId); + + public void GenerateOpSpecConstant(IdResultType resultType, IdResult resultId, LiteralContextDependentNumber value); + + public void GenerateOpSpecConstantComposite(IdResultType resultType, IdResult resultId, params IdRef[] constituents); + + public void GenerateOpSpecConstantOp(IdResultType resultType, IdResult resultId, LiteralSpecConstantOpInteger opcode); + + public void GenerateOpFunction(IdResultType resultType, IdResult resultId, FunctionControl param2, IdRef functionType); + + public void GenerateOpFunctionParameter(IdResultType resultType, IdResult resultId); + + public void GenerateOpFunctionEnd(); + + public void GenerateOpFunctionCall(IdResultType resultType, IdResult resultId, IdRef function, params IdRef[] argument0Argument1); + + public void GenerateOpVariable(IdResultType resultType, IdResult resultId, StorageClass param2, IdRef? initializer = null); + + public void GenerateOpImageTexelPointer(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, IdRef sample); + + public void GenerateOpLoad(IdResultType resultType, IdResult resultId, IdRef pointer, MemoryAccess? param3 = null); + + public void GenerateOpStore(IdRef pointer, IdRef @object, MemoryAccess? param2 = null); + + public void GenerateOpCopyMemory(IdRef target, IdRef source, MemoryAccess? param2 = null, MemoryAccess? param3 = null); + + public void GenerateOpCopyMemorySized(IdRef target, IdRef source, IdRef size, MemoryAccess? param3 = null, MemoryAccess? param4 = null); + + public void GenerateOpAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, params IdRef[] indexes); + + public void GenerateOpInBoundsAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, params IdRef[] indexes); + + public void GenerateOpPtrAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, IdRef element, params IdRef[] indexes); + + public void GenerateOpArrayLength(IdResultType resultType, IdResult resultId, IdRef structure, LiteralInteger arraymember); + + public void GenerateOpGenericPtrMemSemantics(IdResultType resultType, IdResult resultId, IdRef pointer); + + public void GenerateOpInBoundsPtrAccessChain(IdResultType resultType, IdResult resultId, IdRef @base, IdRef element, params IdRef[] indexes); + + public void GenerateOpDecorate(IdRef target, Decoration param1); + + public void GenerateOpMemberDecorate(IdRef structureType, LiteralInteger member, Decoration param2); + + public void GenerateOpDecorationGroup(IdResult resultId); + + public void GenerateOpGroupDecorate(IdRef decorationGroup, params IdRef[] targets); + + public void GenerateOpGroupMemberDecorate(IdRef decorationGroup, params PairIdRefLiteralInteger[] targets); + + public void GenerateOpVectorExtractDynamic(IdResultType resultType, IdResult resultId, IdRef vector, IdRef index); + + public void GenerateOpVectorInsertDynamic(IdResultType resultType, IdResult resultId, IdRef vector, IdRef component, IdRef index); + + public void GenerateOpVectorShuffle(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, params LiteralInteger[] components); + + public void GenerateOpCompositeConstruct(IdResultType resultType, IdResult resultId, params IdRef[] constituents); + + public void GenerateOpCompositeExtract(IdResultType resultType, IdResult resultId, IdRef composite, params LiteralInteger[] indexes); + + public void GenerateOpCompositeInsert(IdResultType resultType, IdResult resultId, IdRef @object, IdRef composite, params LiteralInteger[] indexes); + + public void GenerateOpCopyObject(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpTranspose(IdResultType resultType, IdResult resultId, IdRef matrix); + + public void GenerateOpSampledImage(IdResultType resultType, IdResult resultId, IdRef image, IdRef sampler); + + public void GenerateOpImageSampleImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpImageSampleExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4); + + public void GenerateOpImageSampleDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null); + + public void GenerateOpImageSampleDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5); + + public void GenerateOpImageSampleProjImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpImageSampleProjExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4); + + public void GenerateOpImageSampleProjDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null); + + public void GenerateOpImageSampleProjDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5); + + public void GenerateOpImageFetch(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpImageGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef component, ImageOperands? param5 = null); + + public void GenerateOpImageDrefGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null); + + public void GenerateOpImageRead(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpImageWrite(IdRef image, IdRef coordinate, IdRef texel, ImageOperands? param3 = null); + + public void GenerateOpImage(IdResultType resultType, IdResult resultId, IdRef sampledImage); + + public void GenerateOpImageQueryFormat(IdResultType resultType, IdResult resultId, IdRef image); + + public void GenerateOpImageQueryOrder(IdResultType resultType, IdResult resultId, IdRef image); + + public void GenerateOpImageQuerySizeLod(IdResultType resultType, IdResult resultId, IdRef image, IdRef levelofDetail); + + public void GenerateOpImageQuerySize(IdResultType resultType, IdResult resultId, IdRef image); + + public void GenerateOpImageQueryLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate); + + public void GenerateOpImageQueryLevels(IdResultType resultType, IdResult resultId, IdRef image); + + public void GenerateOpImageQuerySamples(IdResultType resultType, IdResult resultId, IdRef image); + + public void GenerateOpConvertFToU(IdResultType resultType, IdResult resultId, IdRef floatValue); + + public void GenerateOpConvertFToS(IdResultType resultType, IdResult resultId, IdRef floatValue); + + public void GenerateOpConvertSToF(IdResultType resultType, IdResult resultId, IdRef signedValue); + + public void GenerateOpConvertUToF(IdResultType resultType, IdResult resultId, IdRef unsignedValue); + + public void GenerateOpUConvert(IdResultType resultType, IdResult resultId, IdRef unsignedValue); + + public void GenerateOpSConvert(IdResultType resultType, IdResult resultId, IdRef signedValue); + + public void GenerateOpFConvert(IdResultType resultType, IdResult resultId, IdRef floatValue); + + public void GenerateOpQuantizeToF16(IdResultType resultType, IdResult resultId, IdRef value); + + public void GenerateOpConvertPtrToU(IdResultType resultType, IdResult resultId, IdRef pointer); + + public void GenerateOpSatConvertSToU(IdResultType resultType, IdResult resultId, IdRef signedValue); + + public void GenerateOpSatConvertUToS(IdResultType resultType, IdResult resultId, IdRef unsignedValue); + + public void GenerateOpConvertUToPtr(IdResultType resultType, IdResult resultId, IdRef integerValue); + + public void GenerateOpPtrCastToGeneric(IdResultType resultType, IdResult resultId, IdRef pointer); + + public void GenerateOpGenericCastToPtr(IdResultType resultType, IdResult resultId, IdRef pointer); + + public void GenerateOpGenericCastToPtrExplicit(IdResultType resultType, IdResult resultId, IdRef pointer, StorageClass storage); + + public void GenerateOpBitcast(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpSNegate(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpFNegate(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpIAdd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFAdd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpISub(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFSub(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpIMul(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFMul(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUDiv(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSDiv(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFDiv(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUMod(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSRem(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSMod(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFRem(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFMod(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpVectorTimesScalar(IdResultType resultType, IdResult resultId, IdRef vector, IdRef scalar); + + public void GenerateOpMatrixTimesScalar(IdResultType resultType, IdResult resultId, IdRef matrix, IdRef scalar); + + public void GenerateOpVectorTimesMatrix(IdResultType resultType, IdResult resultId, IdRef vector, IdRef matrix); + + public void GenerateOpMatrixTimesVector(IdResultType resultType, IdResult resultId, IdRef matrix, IdRef vector); + + public void GenerateOpMatrixTimesMatrix(IdResultType resultType, IdResult resultId, IdRef leftMatrix, IdRef rightMatrix); + + public void GenerateOpOuterProduct(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2); + + public void GenerateOpDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2); + + public void GenerateOpIAddCarry(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpISubBorrow(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUMulExtended(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSMulExtended(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpAny(IdResultType resultType, IdResult resultId, IdRef vector); + + public void GenerateOpAll(IdResultType resultType, IdResult resultId, IdRef vector); + + public void GenerateOpIsNan(IdResultType resultType, IdResult resultId, IdRef x); + + public void GenerateOpIsInf(IdResultType resultType, IdResult resultId, IdRef x); + + public void GenerateOpIsFinite(IdResultType resultType, IdResult resultId, IdRef x); + + public void GenerateOpIsNormal(IdResultType resultType, IdResult resultId, IdRef x); + + public void GenerateOpSignBitSet(IdResultType resultType, IdResult resultId, IdRef x); + + public void GenerateOpLessOrGreater(IdResultType resultType, IdResult resultId, IdRef x, IdRef y); + + public void GenerateOpOrdered(IdResultType resultType, IdResult resultId, IdRef x, IdRef y); + + public void GenerateOpUnordered(IdResultType resultType, IdResult resultId, IdRef x, IdRef y); + + public void GenerateOpLogicalEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpLogicalNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpLogicalOr(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpLogicalAnd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpLogicalNot(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpSelect(IdResultType resultType, IdResult resultId, IdRef condition, IdRef object1, IdRef object2); + + public void GenerateOpIEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpINotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpULessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSLessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpULessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpSLessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFOrdEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFUnordEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFOrdNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFUnordNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFOrdLessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFUnordLessThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFOrdGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFUnordGreaterThan(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFOrdLessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFUnordLessThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFOrdGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpFUnordGreaterThanEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpShiftRightLogical(IdResultType resultType, IdResult resultId, IdRef @base, IdRef shift); + + public void GenerateOpShiftRightArithmetic(IdResultType resultType, IdResult resultId, IdRef @base, IdRef shift); + + public void GenerateOpShiftLeftLogical(IdResultType resultType, IdResult resultId, IdRef @base, IdRef shift); + + public void GenerateOpBitwiseOr(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpBitwiseXor(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpBitwiseAnd(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpNot(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpBitFieldInsert(IdResultType resultType, IdResult resultId, IdRef @base, IdRef insert, IdRef offset, IdRef count); + + public void GenerateOpBitFieldSExtract(IdResultType resultType, IdResult resultId, IdRef @base, IdRef offset, IdRef count); + + public void GenerateOpBitFieldUExtract(IdResultType resultType, IdResult resultId, IdRef @base, IdRef offset, IdRef count); + + public void GenerateOpBitReverse(IdResultType resultType, IdResult resultId, IdRef @base); + + public void GenerateOpBitCount(IdResultType resultType, IdResult resultId, IdRef @base); + + public void GenerateOpDPdx(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpDPdy(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpFwidth(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpDPdxFine(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpDPdyFine(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpFwidthFine(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpDPdxCoarse(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpDPdyCoarse(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpFwidthCoarse(IdResultType resultType, IdResult resultId, IdRef p); + + public void GenerateOpEmitVertex(); + + public void GenerateOpEndPrimitive(); + + public void GenerateOpEmitStreamVertex(IdRef stream); + + public void GenerateOpEndStreamPrimitive(IdRef stream); + + public void GenerateOpControlBarrier(IdScope execution, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpMemoryBarrier(IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpAtomicLoad(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpAtomicStore(IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicExchange(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicCompareExchange(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics equal, IdMemorySemantics unequal, IdRef value, IdRef comparator); + + public void GenerateOpAtomicCompareExchangeWeak(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics equal, IdMemorySemantics unequal, IdRef value, IdRef comparator); + + public void GenerateOpAtomicIIncrement(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpAtomicIDecrement(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpAtomicIAdd(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicISub(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicSMin(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicUMin(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicSMax(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicUMax(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicAnd(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicOr(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicXor(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpPhi(IdResultType resultType, IdResult resultId, params PairIdRefIdRef[] variableParent); + + public void GenerateOpLoopMerge(IdRef mergeBlock, IdRef continueTarget, LoopControl param2); + + public void GenerateOpSelectionMerge(IdRef mergeBlock, SelectionControl param1); + + public void GenerateOpLabel(IdResult resultId); + + public void GenerateOpBranch(IdRef targetLabel); + + public void GenerateOpBranchConditional(IdRef condition, IdRef trueLabel, IdRef falseLabel, params LiteralInteger[] branchweights); + + public void GenerateOpSwitch(IdRef selector, IdRef @default, params PairLiteralIntegerIdRef[] target); + + public void GenerateOpKill(); + + public void GenerateOpReturn(); + + public void GenerateOpReturnValue(IdRef value); + + public void GenerateOpUnreachable(); + + public void GenerateOpLifetimeStart(IdRef pointer, LiteralInteger size); + + public void GenerateOpLifetimeStop(IdRef pointer, LiteralInteger size); + + public void GenerateOpGroupAsyncCopy(IdResultType resultType, IdResult resultId, IdScope execution, IdRef destination, IdRef source, IdRef numElements, IdRef stride, IdRef @event); + + public void GenerateOpGroupWaitEvents(IdScope execution, IdRef numEvents, IdRef eventsList); + + public void GenerateOpGroupAll(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate); + + public void GenerateOpGroupAny(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate); + + public void GenerateOpGroupBroadcast(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef localId); + + public void GenerateOpGroupIAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupFAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupFMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupUMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupSMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupFMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupUMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupSMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpReadPipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef pointer, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpWritePipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef pointer, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpReservedReadPipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef reserveId, IdRef index, IdRef pointer, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpReservedWritePipe(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef reserveId, IdRef index, IdRef pointer, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpReserveReadPipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpReserveWritePipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpCommitReadPipe(IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpCommitWritePipe(IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpIsValidReserveId(IdResultType resultType, IdResult resultId, IdRef reserveId); + + public void GenerateOpGetNumPipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpGetMaxPipePackets(IdResultType resultType, IdResult resultId, IdRef pipe, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpGroupReserveReadPipePackets(IdResultType resultType, IdResult resultId, IdScope execution, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpGroupReserveWritePipePackets(IdResultType resultType, IdResult resultId, IdScope execution, IdRef pipe, IdRef numPackets, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpGroupCommitReadPipe(IdScope execution, IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpGroupCommitWritePipe(IdScope execution, IdRef pipe, IdRef reserveId, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpEnqueueMarker(IdResultType resultType, IdResult resultId, IdRef queue, IdRef numEvents, IdRef waitEvents, IdRef retEvent); + + public void GenerateOpEnqueueKernel(IdResultType resultType, IdResult resultId, IdRef queue, IdRef flags, IdRef nDRange, IdRef numEvents, IdRef waitEvents, IdRef retEvent, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign, params IdRef[] localSize); + + public void GenerateOpGetKernelNDrangeSubGroupCount(IdResultType resultType, IdResult resultId, IdRef nDRange, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign); + + public void GenerateOpGetKernelNDrangeMaxSubGroupSize(IdResultType resultType, IdResult resultId, IdRef nDRange, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign); + + public void GenerateOpGetKernelWorkGroupSize(IdResultType resultType, IdResult resultId, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign); + + public void GenerateOpGetKernelPreferredWorkGroupSizeMultiple(IdResultType resultType, IdResult resultId, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign); + + public void GenerateOpRetainEvent(IdRef @event); + + public void GenerateOpReleaseEvent(IdRef @event); + + public void GenerateOpCreateUserEvent(IdResultType resultType, IdResult resultId); + + public void GenerateOpIsValidEvent(IdResultType resultType, IdResult resultId, IdRef @event); + + public void GenerateOpSetUserEventStatus(IdRef @event, IdRef status); + + public void GenerateOpCaptureEventProfilingInfo(IdRef @event, IdRef profilingInfo, IdRef value); + + public void GenerateOpGetDefaultQueue(IdResultType resultType, IdResult resultId); + + public void GenerateOpBuildNDRange(IdResultType resultType, IdResult resultId, IdRef globalWorkSize, IdRef localWorkSize, IdRef globalWorkOffset); + + public void GenerateOpImageSparseSampleImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpImageSparseSampleExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4); + + public void GenerateOpImageSparseSampleDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null); + + public void GenerateOpImageSparseSampleDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5); + + public void GenerateOpImageSparseSampleProjImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpImageSparseSampleProjExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, ImageOperands param4); + + public void GenerateOpImageSparseSampleProjDrefImplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null); + + public void GenerateOpImageSparseSampleProjDrefExplicitLod(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands param5); + + public void GenerateOpImageSparseFetch(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpImageSparseGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef component, ImageOperands? param5 = null); + + public void GenerateOpImageSparseDrefGather(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef dref, ImageOperands? param5 = null); + + public void GenerateOpImageSparseTexelsResident(IdResultType resultType, IdResult resultId, IdRef residentCode); + + public void GenerateOpNoLine(); + + public void GenerateOpAtomicFlagTestAndSet(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpAtomicFlagClear(IdRef pointer, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpImageSparseRead(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, ImageOperands? param4 = null); + + public void GenerateOpSizeOf(IdResultType resultType, IdResult resultId, IdRef pointer); + + public void GenerateOpTypePipeStorage(IdResult resultId); + + public void GenerateOpConstantPipeStorage(IdResultType resultType, IdResult resultId, LiteralInteger packetSize, LiteralInteger packetAlignment, LiteralInteger capacity); + + public void GenerateOpCreatePipeFromPipeStorage(IdResultType resultType, IdResult resultId, IdRef pipeStorage); + + public void GenerateOpGetKernelLocalSizeForSubgroupCount(IdResultType resultType, IdResult resultId, IdRef subgroupCount, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign); + + public void GenerateOpGetKernelMaxNumSubgroups(IdResultType resultType, IdResult resultId, IdRef invoke, IdRef param, IdRef paramSize, IdRef paramAlign); + + public void GenerateOpTypeNamedBarrier(IdResult resultId); + + public void GenerateOpNamedBarrierInitialize(IdResultType resultType, IdResult resultId, IdRef subgroupCount); + + public void GenerateOpMemoryNamedBarrier(IdRef namedBarrier, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpModuleProcessed(LiteralString process); + + public void GenerateOpExecutionModeId(IdRef entryPoint, ExecutionMode mode); + + public void GenerateOpDecorateId(IdRef target, Decoration param1); + + public void GenerateOpGroupNonUniformElect(IdResultType resultType, IdResult resultId, IdScope execution); + + public void GenerateOpGroupNonUniformAll(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate); + + public void GenerateOpGroupNonUniformAny(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate); + + public void GenerateOpGroupNonUniformAllEqual(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value); + + public void GenerateOpGroupNonUniformBroadcast(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef id); + + public void GenerateOpGroupNonUniformBroadcastFirst(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value); + + public void GenerateOpGroupNonUniformBallot(IdResultType resultType, IdResult resultId, IdScope execution, IdRef predicate); + + public void GenerateOpGroupNonUniformInverseBallot(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value); + + public void GenerateOpGroupNonUniformBallotBitExtract(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef index); + + public void GenerateOpGroupNonUniformBallotBitCount(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value); + + public void GenerateOpGroupNonUniformBallotFindLSB(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value); + + public void GenerateOpGroupNonUniformBallotFindMSB(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value); + + public void GenerateOpGroupNonUniformShuffle(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef id); + + public void GenerateOpGroupNonUniformShuffleXor(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef mask); + + public void GenerateOpGroupNonUniformShuffleUp(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef delta); + + public void GenerateOpGroupNonUniformShuffleDown(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef delta); + + public void GenerateOpGroupNonUniformIAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformFAdd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformIMul(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformFMul(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformSMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformUMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformFMin(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformSMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformUMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformFMax(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformBitwiseAnd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformBitwiseOr(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformBitwiseXor(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformLogicalAnd(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformLogicalOr(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformLogicalXor(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef value, IdRef? clusterSize = null); + + public void GenerateOpGroupNonUniformQuadBroadcast(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef index); + + public void GenerateOpGroupNonUniformQuadSwap(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef direction); + + public void GenerateOpCopyLogical(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpPtrEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpPtrNotEqual(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpPtrDiff(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpColorAttachmentReadEXT(IdResultType resultType, IdResult resultId, IdRef attachment, IdRef? sample = null); + + public void GenerateOpDepthAttachmentReadEXT(IdResultType resultType, IdResult resultId, IdRef? sample = null); + + public void GenerateOpStencilAttachmentReadEXT(IdResultType resultType, IdResult resultId, IdRef? sample = null); + + public void GenerateOpTerminateInvocation(); + + public void GenerateOpSubgroupBallotKHR(IdResultType resultType, IdResult resultId, IdRef predicate); + + public void GenerateOpSubgroupFirstInvocationKHR(IdResultType resultType, IdResult resultId, IdRef value); + + public void GenerateOpSubgroupAllKHR(IdResultType resultType, IdResult resultId, IdRef predicate); + + public void GenerateOpSubgroupAnyKHR(IdResultType resultType, IdResult resultId, IdRef predicate); + + public void GenerateOpSubgroupAllEqualKHR(IdResultType resultType, IdResult resultId, IdRef predicate); + + public void GenerateOpGroupNonUniformRotateKHR(IdResultType resultType, IdResult resultId, IdScope execution, IdRef value, IdRef delta, IdRef? clusterSize = null); + + public void GenerateOpSubgroupReadInvocationKHR(IdResultType resultType, IdResult resultId, IdRef value, IdRef index); + + public void GenerateOpTraceRayKHR(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef payload); + + public void GenerateOpExecuteCallableKHR(IdRef sBTIndex, IdRef callableData); + + public void GenerateOpConvertUToAccelerationStructureKHR(IdResultType resultType, IdResult resultId, IdRef accel); + + public void GenerateOpIgnoreIntersectionKHR(); + + public void GenerateOpTerminateRayKHR(); + + public void GenerateOpSDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpSDotKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpUDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpUDotKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpSUDot(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpSUDotKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpSDotAccSat(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpSDotAccSatKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpUDotAccSat(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpUDotAccSatKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpSUDotAccSat(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpSUDotAccSatKHR(IdResultType resultType, IdResult resultId, IdRef vector1, IdRef vector2, IdRef accumulator, PackedVectorFormat? packedVectorFormat = null); + + public void GenerateOpTypeCooperativeMatrixKHR(IdResult resultId, IdRef componentType, IdScope scope, IdRef rows, IdRef columns, IdRef use); + + public void GenerateOpCooperativeMatrixLoadKHR(IdResultType resultType, IdResult resultId, IdRef pointer, IdRef memoryLayout, IdRef? stride = null, MemoryAccess? memoryOperand = null); + + public void GenerateOpCooperativeMatrixStoreKHR(IdRef pointer, IdRef @object, IdRef memoryLayout, IdRef? stride = null, MemoryAccess? memoryOperand = null); + + public void GenerateOpCooperativeMatrixMulAddKHR(IdResultType resultType, IdResult resultId, IdRef a, IdRef b, IdRef c, CooperativeMatrixOperands? cooperativeMatrixOperands = null); + + public void GenerateOpCooperativeMatrixLengthKHR(IdResultType resultType, IdResult resultId, IdRef type); + + public void GenerateOpTypeRayQueryKHR(IdResult resultId); + + public void GenerateOpRayQueryInitializeKHR(IdRef rayQuery, IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef rayOrigin, IdRef rayTMin, IdRef rayDirection, IdRef rayTMax); + + public void GenerateOpRayQueryTerminateKHR(IdRef rayQuery); + + public void GenerateOpRayQueryGenerateIntersectionKHR(IdRef rayQuery, IdRef hitT); + + public void GenerateOpRayQueryConfirmIntersectionKHR(IdRef rayQuery); + + public void GenerateOpRayQueryProceedKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery); + + public void GenerateOpRayQueryGetIntersectionTypeKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpImageSampleWeightedQCOM(IdResultType resultType, IdResult resultId, IdRef texture, IdRef coordinates, IdRef weights); + + public void GenerateOpImageBoxFilterQCOM(IdResultType resultType, IdResult resultId, IdRef texture, IdRef coordinates, IdRef boxSize); + + public void GenerateOpImageBlockMatchSSDQCOM(IdResultType resultType, IdResult resultId, IdRef target, IdRef targetCoordinates, IdRef reference, IdRef referenceCoordinates, IdRef blockSize); + + public void GenerateOpImageBlockMatchSADQCOM(IdResultType resultType, IdResult resultId, IdRef target, IdRef targetCoordinates, IdRef reference, IdRef referenceCoordinates, IdRef blockSize); + + public void GenerateOpGroupIAddNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupFAddNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupFMinNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupUMinNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupSMinNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupFMaxNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupUMaxNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupSMaxNonUniformAMD(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpFragmentMaskFetchAMD(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate); + + public void GenerateOpFragmentFetchAMD(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, IdRef fragmentIndex); + + public void GenerateOpReadClockKHR(IdResultType resultType, IdResult resultId, IdScope scope); + + public void GenerateOpFinalizeNodePayloadsAMDX(IdRef payloadArray); + + public void GenerateOpFinishWritingNodePayloadAMDX(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpInitializeNodePayloadsAMDX(IdRef payloadArray, IdScope visibility, IdRef payloadCount, IdRef nodeIndex); + + public void GenerateOpHitObjectRecordHitMotionNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef currentTime, IdRef hitObjectAttributes); + + public void GenerateOpHitObjectRecordHitWithIndexMotionNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef currentTime, IdRef hitObjectAttributes); + + public void GenerateOpHitObjectRecordMissMotionNV(IdRef hitObject, IdRef sBTIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef currentTime); + + public void GenerateOpHitObjectGetWorldToObjectNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetObjectToWorldNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetObjectRayDirectionNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetObjectRayOriginNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectTraceRayMotionNV(IdRef hitObject, IdRef accelerationStructure, IdRef rayFlags, IdRef cullmask, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef missIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef time, IdRef payload); + + public void GenerateOpHitObjectGetShaderRecordBufferHandleNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetShaderBindingTableRecordIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectRecordEmptyNV(IdRef hitObject); + + public void GenerateOpHitObjectTraceRayNV(IdRef hitObject, IdRef accelerationStructure, IdRef rayFlags, IdRef cullmask, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef missIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef payload); + + public void GenerateOpHitObjectRecordHitNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordOffset, IdRef sBTRecordStride, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef hitObjectAttributes); + + public void GenerateOpHitObjectRecordHitWithIndexNV(IdRef hitObject, IdRef accelerationStructure, IdRef instanceId, IdRef primitiveId, IdRef geometryIndex, IdRef hitKind, IdRef sBTRecordIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax, IdRef hitObjectAttributes); + + public void GenerateOpHitObjectRecordMissNV(IdRef hitObject, IdRef sBTIndex, IdRef origin, IdRef tMin, IdRef direction, IdRef tMax); + + public void GenerateOpHitObjectExecuteShaderNV(IdRef hitObject, IdRef payload); + + public void GenerateOpHitObjectGetCurrentTimeNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetAttributesNV(IdRef hitObject, IdRef hitObjectAttribute); + + public void GenerateOpHitObjectGetHitKindNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetPrimitiveIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetGeometryIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetInstanceIdNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetInstanceCustomIndexNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetWorldRayDirectionNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetWorldRayOriginNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetRayTMaxNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectGetRayTMinNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectIsEmptyNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectIsHitNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpHitObjectIsMissNV(IdResultType resultType, IdResult resultId, IdRef hitObject); + + public void GenerateOpReorderThreadWithHitObjectNV(IdRef hitObject, IdRef? hint = null, IdRef? bits = null); + + public void GenerateOpReorderThreadWithHintNV(IdRef hint, IdRef bits); + + public void GenerateOpTypeHitObjectNV(IdResult resultId); + + public void GenerateOpImageSampleFootprintNV(IdResultType resultType, IdResult resultId, IdRef sampledImage, IdRef coordinate, IdRef granularity, IdRef coarse, ImageOperands? param6 = null); + + public void GenerateOpEmitMeshTasksEXT(IdRef groupCountX, IdRef groupCountY, IdRef groupCountZ, IdRef? payload = null); + + public void GenerateOpSetMeshOutputsEXT(IdRef vertexCount, IdRef primitiveCount); + + public void GenerateOpGroupNonUniformPartitionNV(IdResultType resultType, IdResult resultId, IdRef value); + + public void GenerateOpWritePackedPrimitiveIndices4x8NV(IdRef indexOffset, IdRef packedIndices); + + public void GenerateOpReportIntersectionNV(IdResultType resultType, IdResult resultId, IdRef hit, IdRef hitKind); + + public void GenerateOpReportIntersectionKHR(IdResultType resultType, IdResult resultId, IdRef hit, IdRef hitKind); + + public void GenerateOpIgnoreIntersectionNV(); + + public void GenerateOpTerminateRayNV(); + + public void GenerateOpTraceNV(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef payloadId); + + public void GenerateOpTraceMotionNV(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef time, IdRef payloadId); + + public void GenerateOpTraceRayMotionNV(IdRef accel, IdRef rayFlags, IdRef cullMask, IdRef sBTOffset, IdRef sBTStride, IdRef missIndex, IdRef rayOrigin, IdRef rayTmin, IdRef rayDirection, IdRef rayTmax, IdRef time, IdRef payload); + + public void GenerateOpRayQueryGetIntersectionTriangleVertexPositionsKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpTypeAccelerationStructureNV(IdResult resultId); + + public void GenerateOpTypeAccelerationStructureKHR(IdResult resultId); + + public void GenerateOpExecuteCallableNV(IdRef sBTIndex, IdRef callableDataId); + + public void GenerateOpTypeCooperativeMatrixNV(IdResult resultId, IdRef componentType, IdScope execution, IdRef rows, IdRef columns); + + public void GenerateOpCooperativeMatrixLoadNV(IdResultType resultType, IdResult resultId, IdRef pointer, IdRef stride, IdRef columnMajor, MemoryAccess? param5 = null); + + public void GenerateOpCooperativeMatrixStoreNV(IdRef pointer, IdRef @object, IdRef stride, IdRef columnMajor, MemoryAccess? param4 = null); + + public void GenerateOpCooperativeMatrixMulAddNV(IdResultType resultType, IdResult resultId, IdRef a, IdRef b, IdRef c); + + public void GenerateOpCooperativeMatrixLengthNV(IdResultType resultType, IdResult resultId, IdRef type); + + public void GenerateOpBeginInvocationInterlockEXT(); + + public void GenerateOpEndInvocationInterlockEXT(); + + public void GenerateOpDemoteToHelperInvocation(); + + public void GenerateOpDemoteToHelperInvocationEXT(); + + public void GenerateOpIsHelperInvocationEXT(IdResultType resultType, IdResult resultId); + + public void GenerateOpConvertUToImageNV(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpConvertUToSamplerNV(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpConvertImageToUNV(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpConvertSamplerToUNV(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpConvertUToSampledImageNV(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpConvertSampledImageToUNV(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpSamplerImageAddressingModeNV(LiteralInteger bitWidth); + + public void GenerateOpSubgroupShuffleINTEL(IdResultType resultType, IdResult resultId, IdRef data, IdRef invocationId); + + public void GenerateOpSubgroupShuffleDownINTEL(IdResultType resultType, IdResult resultId, IdRef current, IdRef next, IdRef delta); + + public void GenerateOpSubgroupShuffleUpINTEL(IdResultType resultType, IdResult resultId, IdRef previous, IdRef current, IdRef delta); + + public void GenerateOpSubgroupShuffleXorINTEL(IdResultType resultType, IdResult resultId, IdRef data, IdRef value); + + public void GenerateOpSubgroupBlockReadINTEL(IdResultType resultType, IdResult resultId, IdRef ptr); + + public void GenerateOpSubgroupBlockWriteINTEL(IdRef ptr, IdRef data); + + public void GenerateOpSubgroupImageBlockReadINTEL(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate); + + public void GenerateOpSubgroupImageBlockWriteINTEL(IdRef image, IdRef coordinate, IdRef data); + + public void GenerateOpSubgroupImageMediaBlockReadINTEL(IdResultType resultType, IdResult resultId, IdRef image, IdRef coordinate, IdRef width, IdRef height); + + public void GenerateOpSubgroupImageMediaBlockWriteINTEL(IdRef image, IdRef coordinate, IdRef width, IdRef height, IdRef data); + + public void GenerateOpUCountLeadingZerosINTEL(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpUCountTrailingZerosINTEL(IdResultType resultType, IdResult resultId, IdRef operand); + + public void GenerateOpAbsISubINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpAbsUSubINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpIAddSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUAddSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpIAverageINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUAverageINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpIAverageRoundedINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUAverageRoundedINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpISubSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUSubSatINTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpIMul32x16INTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpUMul32x16INTEL(IdResultType resultType, IdResult resultId, IdRef operand1, IdRef operand2); + + public void GenerateOpConstantFunctionPointerINTEL(IdResultType resultType, IdResult resultId, IdRef function); + + public void GenerateOpFunctionPointerCallINTEL(IdResultType resultType, IdResult resultId, params IdRef[] operand1); + + public void GenerateOpAsmTargetINTEL(IdResultType resultType, IdResult resultId, LiteralString asmtarget); + + public void GenerateOpAsmINTEL(IdResultType resultType, IdResult resultId, IdRef asmtype, IdRef target, LiteralString asminstructions, LiteralString constraints); + + public void GenerateOpAsmCallINTEL(IdResultType resultType, IdResult resultId, IdRef asm, params IdRef[] argument0); + + public void GenerateOpAtomicFMinEXT(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAtomicFMaxEXT(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpAssumeTrueKHR(IdRef condition); + + public void GenerateOpExpectKHR(IdResultType resultType, IdResult resultId, IdRef value, IdRef expectedValue); + + public void GenerateOpDecorateString(IdRef target, Decoration param1); + + public void GenerateOpDecorateStringGOOGLE(IdRef target, Decoration param1); + + public void GenerateOpMemberDecorateString(IdRef structType, LiteralInteger member, Decoration param2); + + public void GenerateOpMemberDecorateStringGOOGLE(IdRef structType, LiteralInteger member, Decoration param2); + + public void GenerateOpVmeImageINTEL(IdResultType resultType, IdResult resultId, IdRef imageType, IdRef sampler); + + public void GenerateOpTypeVmeImageINTEL(IdResult resultId, IdRef imageType); + + public void GenerateOpTypeAvcImePayloadINTEL(IdResult resultId); + + public void GenerateOpTypeAvcRefPayloadINTEL(IdResult resultId); + + public void GenerateOpTypeAvcSicPayloadINTEL(IdResult resultId); + + public void GenerateOpTypeAvcMcePayloadINTEL(IdResult resultId); + + public void GenerateOpTypeAvcMceResultINTEL(IdResult resultId); + + public void GenerateOpTypeAvcImeResultINTEL(IdResult resultId); + + public void GenerateOpTypeAvcImeResultSingleReferenceStreamoutINTEL(IdResult resultId); + + public void GenerateOpTypeAvcImeResultDualReferenceStreamoutINTEL(IdResult resultId); + + public void GenerateOpTypeAvcImeSingleReferenceStreaminINTEL(IdResult resultId); + + public void GenerateOpTypeAvcImeDualReferenceStreaminINTEL(IdResult resultId); + + public void GenerateOpTypeAvcRefResultINTEL(IdResult resultId); + + public void GenerateOpTypeAvcSicResultINTEL(IdResult resultId); + + public void GenerateOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp); + + public void GenerateOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef referenceBasePenalty, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp); + + public void GenerateOpSubgroupAvcMceSetInterShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef packedShapePenalty, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp); + + public void GenerateOpSubgroupAvcMceSetInterDirectionPenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef directionCost, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp); + + public void GenerateOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp); + + public void GenerateOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL(IdResultType resultType, IdResult resultId); + + public void GenerateOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL(IdResultType resultType, IdResult resultId); + + public void GenerateOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL(IdResultType resultType, IdResult resultId); + + public void GenerateOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL(IdResultType resultType, IdResult resultId, IdRef packedCostCenterDelta, IdRef packedCostTable, IdRef costPrecision, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef sliceType, IdRef qp); + + public void GenerateOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL(IdResultType resultType, IdResult resultId); + + public void GenerateOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL(IdResultType resultType, IdResult resultId); + + public void GenerateOpSubgroupAvcMceSetAcOnlyHaarINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL(IdResultType resultType, IdResult resultId, IdRef sourceFieldPolarity, IdRef payload); + + public void GenerateOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL(IdResultType resultType, IdResult resultId, IdRef referenceFieldPolarity, IdRef payload); + + public void GenerateOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL(IdResultType resultType, IdResult resultId, IdRef forwardReferenceFieldPolarity, IdRef backwardReferenceFieldPolarity, IdRef payload); + + public void GenerateOpSubgroupAvcMceConvertToImePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceConvertToImeResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceConvertToRefPayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceConvertToRefResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceConvertToSicPayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceConvertToSicResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetMotionVectorsINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetInterDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetBestInterDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetInterMajorShapeINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetInterMinorShapeINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetInterDirectionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetInterMotionVectorCountINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetInterReferenceIdsINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL(IdResultType resultType, IdResult resultId, IdRef packedReferenceIds, IdRef packedReferenceParameterFieldPolarities, IdRef payload); + + public void GenerateOpSubgroupAvcImeInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord, IdRef partitionMask, IdRef sADAdjustment); + + public void GenerateOpSubgroupAvcImeSetSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef refOffset, IdRef searchWindowConfig, IdRef payload); + + public void GenerateOpSubgroupAvcImeSetDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef fwdRefOffset, IdRef bwdRefOffset, IdRef idSearchWindowConfig, IdRef payload); + + public void GenerateOpSubgroupAvcImeRefWindowSizeINTEL(IdResultType resultType, IdResult resultId, IdRef searchWindowConfig, IdRef dualRef); + + public void GenerateOpSubgroupAvcImeAdjustRefOffsetINTEL(IdResultType resultType, IdResult resultId, IdRef refOffset, IdRef srcCoord, IdRef refWindowSize, IdRef imageSize); + + public void GenerateOpSubgroupAvcImeConvertToMcePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeSetMaxMotionVectorCountINTEL(IdResultType resultType, IdResult resultId, IdRef maxMotionVectorCount, IdRef payload); + + public void GenerateOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL(IdResultType resultType, IdResult resultId, IdRef threshold, IdRef payload); + + public void GenerateOpSubgroupAvcImeSetWeightedSadINTEL(IdResultType resultType, IdResult resultId, IdRef packedSadWeights, IdRef payload); + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload); + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload); + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload, IdRef streaminComponents); + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload, IdRef streaminComponents); + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload); + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload); + + public void GenerateOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload, IdRef streaminComponents); + + public void GenerateOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload, IdRef streaminComponents); + + public void GenerateOpSubgroupAvcImeConvertToMceResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeGetSingleReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeGetDualReferenceStreaminINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeStripDualReferenceStreamoutINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape); + + public void GenerateOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape); + + public void GenerateOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape); + + public void GenerateOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape, IdRef direction); + + public void GenerateOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape, IdRef direction); + + public void GenerateOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL(IdResultType resultType, IdResult resultId, IdRef payload, IdRef majorShape, IdRef direction); + + public void GenerateOpSubgroupAvcImeGetBorderReachedINTEL(IdResultType resultType, IdResult resultId, IdRef imageSelect, IdRef payload); + + public void GenerateOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcFmeInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord, IdRef motionVectors, IdRef majorShapes, IdRef minorShapes, IdRef direction, IdRef pixelResolution, IdRef sadAdjustment); + + public void GenerateOpSubgroupAvcBmeInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord, IdRef motionVectors, IdRef majorShapes, IdRef minorShapes, IdRef direction, IdRef pixelResolution, IdRef bidirectionalWeight, IdRef sadAdjustment); + + public void GenerateOpSubgroupAvcRefConvertToMcePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcRefSetBidirectionalMixDisableINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcRefSetBilinearFilterEnableINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload); + + public void GenerateOpSubgroupAvcRefEvaluateWithDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload); + + public void GenerateOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef payload); + + public void GenerateOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef packedReferenceFieldPolarities, IdRef payload); + + public void GenerateOpSubgroupAvcRefConvertToMceResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicInitializeINTEL(IdResultType resultType, IdResult resultId, IdRef srcCoord); + + public void GenerateOpSubgroupAvcSicConfigureSkcINTEL(IdResultType resultType, IdResult resultId, IdRef skipBlockPartitionType, IdRef skipMotionVectorMask, IdRef motionVectors, IdRef bidirectionalWeight, IdRef sadAdjustment, IdRef payload); + + public void GenerateOpSubgroupAvcSicConfigureIpeLumaINTEL(IdResultType resultType, IdResult resultId, IdRef lumaIntraPartitionMask, IdRef intraNeighbourAvailabilty, IdRef leftEdgeLumaPixels, IdRef upperLeftCornerLumaPixel, IdRef upperEdgeLumaPixels, IdRef upperRightEdgeLumaPixels, IdRef sadAdjustment, IdRef payload); + + public void GenerateOpSubgroupAvcSicConfigureIpeLumaChromaINTEL(IdResultType resultType, IdResult resultId, IdRef lumaIntraPartitionMask, IdRef intraNeighbourAvailabilty, IdRef leftEdgeLumaPixels, IdRef upperLeftCornerLumaPixel, IdRef upperEdgeLumaPixels, IdRef upperRightEdgeLumaPixels, IdRef leftEdgeChromaPixels, IdRef upperLeftCornerChromaPixel, IdRef upperEdgeChromaPixels, IdRef sadAdjustment, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetMotionVectorMaskINTEL(IdResultType resultType, IdResult resultId, IdRef skipBlockPartitionType, IdRef direction); + + public void GenerateOpSubgroupAvcSicConvertToMcePayloadINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL(IdResultType resultType, IdResult resultId, IdRef packedShapePenalty, IdRef payload); + + public void GenerateOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL(IdResultType resultType, IdResult resultId, IdRef lumaModePenalty, IdRef lumaPackedNeighborModes, IdRef lumaPackedNonDcPenalty, IdRef payload); + + public void GenerateOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL(IdResultType resultType, IdResult resultId, IdRef chromaModeBasePenalty, IdRef payload); + + public void GenerateOpSubgroupAvcSicSetBilinearFilterEnableINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL(IdResultType resultType, IdResult resultId, IdRef packedSadCoefficients, IdRef payload); + + public void GenerateOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL(IdResultType resultType, IdResult resultId, IdRef blockBasedSkipType, IdRef payload); + + public void GenerateOpSubgroupAvcSicEvaluateIpeINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef payload); + + public void GenerateOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef refImage, IdRef payload); + + public void GenerateOpSubgroupAvcSicEvaluateWithDualReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef fwdRefImage, IdRef bwdRefImage, IdRef payload); + + public void GenerateOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef payload); + + public void GenerateOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL(IdResultType resultType, IdResult resultId, IdRef srcImage, IdRef packedReferenceIds, IdRef packedReferenceFieldPolarities, IdRef payload); + + public void GenerateOpSubgroupAvcSicConvertToMceResultINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetIpeLumaShapeINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetPackedIpeLumaModesINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetIpeChromaModeINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpSubgroupAvcSicGetInterRawSadsINTEL(IdResultType resultType, IdResult resultId, IdRef payload); + + public void GenerateOpVariableLengthArrayINTEL(IdResultType resultType, IdResult resultId, IdRef lenght); + + public void GenerateOpSaveMemoryINTEL(IdResultType resultType, IdResult resultId); + + public void GenerateOpRestoreMemoryINTEL(IdRef ptr); + + public void GenerateOpArbitraryFloatSinCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger fromSign, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatCastINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatCastFromIntINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger mout, LiteralInteger fromSign, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatCastToIntINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatAddINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatSubINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatMulINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatDivINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatGTINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2); + + public void GenerateOpArbitraryFloatGEINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2); + + public void GenerateOpArbitraryFloatLTINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2); + + public void GenerateOpArbitraryFloatLEINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2); + + public void GenerateOpArbitraryFloatEQINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2); + + public void GenerateOpArbitraryFloatRecipINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatRSqrtINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatCbrtINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatHypotINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatSqrtINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatLogINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatLog2INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatLog10INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatLog1pINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatExpINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatExp2INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatExp10INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatExpm1INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatSinINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatCosINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatSinCosINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatSinPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatASinINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatASinPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatACosINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatACosPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatATanINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatATanPiINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatATan2INTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatPowINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatPowRINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger m2, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpArbitraryFloatPowNINTEL(IdResultType resultType, IdResult resultId, IdRef a, LiteralInteger m1, IdRef b, LiteralInteger mout, LiteralInteger enableSubnormals, LiteralInteger roundingMode, LiteralInteger roundingAccuracy); + + public void GenerateOpLoopControlINTEL(params LiteralInteger[] loopControlParameters); + + public void GenerateOpAliasDomainDeclINTEL(IdResult resultId, IdRef? name = null); + + public void GenerateOpAliasScopeDeclINTEL(IdResult resultId, IdRef aliasDomain, IdRef? name = null); + + public void GenerateOpAliasScopeListDeclINTEL(IdResult resultId, params IdRef[] aliasScope1AliasScope2); + + public void GenerateOpFixedSqrtINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedRecipINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedRsqrtINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedSinINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedCosINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedSinCosINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedSinPiINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedSinCosPiINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedLogINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpFixedExpINTEL(IdResultType resultType, IdResult resultId, IdRef inputType, IdRef input, LiteralInteger s, LiteralInteger i, LiteralInteger rI, LiteralInteger q, LiteralInteger o); + + public void GenerateOpPtrCastToCrossWorkgroupINTEL(IdResultType resultType, IdResult resultId, IdRef pointer); + + public void GenerateOpCrossWorkgroupCastToPtrINTEL(IdResultType resultType, IdResult resultId, IdRef pointer); + + public void GenerateOpReadPipeBlockingINTEL(IdResultType resultType, IdResult resultId, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpWritePipeBlockingINTEL(IdResultType resultType, IdResult resultId, IdRef packetSize, IdRef packetAlignment); + + public void GenerateOpFPGARegINTEL(IdResultType resultType, IdResult resultId, IdRef result, IdRef input); + + public void GenerateOpRayQueryGetRayTMinKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery); + + public void GenerateOpRayQueryGetRayFlagsKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery); + + public void GenerateOpRayQueryGetIntersectionTKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionInstanceCustomIndexKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionInstanceIdKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionGeometryIndexKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionPrimitiveIndexKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionBarycentricsKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionFrontFaceKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionCandidateAABBOpaqueKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery); + + public void GenerateOpRayQueryGetIntersectionObjectRayDirectionKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionObjectRayOriginKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetWorldRayDirectionKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery); + + public void GenerateOpRayQueryGetWorldRayOriginKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery); + + public void GenerateOpRayQueryGetIntersectionObjectToWorldKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpRayQueryGetIntersectionWorldToObjectKHR(IdResultType resultType, IdResult resultId, IdRef rayQuery, IdRef intersection); + + public void GenerateOpAtomicFAddEXT(IdResultType resultType, IdResult resultId, IdRef pointer, IdScope memory, IdMemorySemantics semantics, IdRef value); + + public void GenerateOpTypeBufferSurfaceINTEL(IdResult resultId, AccessQualifier accessQualifier); + + public void GenerateOpTypeStructContinuedINTEL(params IdRef[] member0typemember1type); + + public void GenerateOpConstantCompositeContinuedINTEL(params IdRef[] constituents); + + public void GenerateOpSpecConstantCompositeContinuedINTEL(params IdRef[] constituents); + + public void GenerateOpConvertFToBF16INTEL(IdResultType resultType, IdResult resultId, IdRef floatValue); + + public void GenerateOpConvertBF16ToFINTEL(IdResultType resultType, IdResult resultId, IdRef bFloat16Value); + + public void GenerateOpControlBarrierArriveINTEL(IdScope execution, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpControlBarrierWaitINTEL(IdScope execution, IdScope memory, IdMemorySemantics semantics); + + public void GenerateOpGroupIMulKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupFMulKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupBitwiseAndKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupBitwiseOrKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupBitwiseXorKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupLogicalAndKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupLogicalOrKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + public void GenerateOpGroupLogicalXorKHR(IdResultType resultType, IdResult resultId, IdScope execution, GroupOperation operation, IdRef x); + + } +} + +#nullable restore diff --git a/Src/ILGPU/Backends/SPIRV/SPIRVBuilderUtils.cs b/Src/ILGPU/Backends/SPIRV/SPIRVBuilderUtils.cs new file mode 100644 index 000000000..afeed3c28 --- /dev/null +++ b/Src/ILGPU/Backends/SPIRV/SPIRVBuilderUtils.cs @@ -0,0 +1,26 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: SPIRVBuilderUtils.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +namespace ILGPU.Backends.SPIRV +{ + internal static class SPIRVBuilderUtils + { + public static uint JoinOpCodeWordCount(ushort opCode, ushort wordCount) + { + uint opCodeUint = opCode; + uint wordCountUint = wordCount; + + uint shiftedWordCount = wordCountUint << 16; + + return shiftedWordCount | opCodeUint; + } + } +} diff --git a/Src/ILGPU/Backends/SPIRV/SPIRVWord.cs b/Src/ILGPU/Backends/SPIRV/SPIRVWord.cs new file mode 100644 index 000000000..9b8d3962e --- /dev/null +++ b/Src/ILGPU/Backends/SPIRV/SPIRVWord.cs @@ -0,0 +1,65 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: SPIRVWord.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using System; + +namespace ILGPU.Backends.SPIRV +{ + internal struct SPIRVWord + { + public uint Data { get; } + private const int BytesPerWord = sizeof(uint); + + public SPIRVWord(uint value) + { + Data = value; + } + + public static SPIRVWord FromBytes(ReadOnlySpan bytes) + { + if (bytes.Length > BytesPerWord) + { + throw new ArgumentException( + "The provided span must be at most 4 bytes long.", + nameof(bytes)); + } + + return new SPIRVWord(BitConverter.ToUInt32(bytes.ToArray(), 0)); + } + + public static SPIRVWord[] ManyFromBytes(ReadOnlySpan bytes) + { + // Round up bytes.Length / BytesPerWord + var words = new SPIRVWord[(bytes.Length - 1) / BytesPerWord + 1]; + + for (int i = 0; i < words.Length; i++) + { + int bytesIndex = i * BytesPerWord; + // Check if we can take a word more bytes, + // if we can't then just take what's left + if (bytesIndex + BytesPerWord > bytes.Length) + { + words[i] = FromBytes(bytes.Slice(bytesIndex)); + } + else + { + words[i] = FromBytes(bytes.Slice(bytesIndex, BytesPerWord)); + } + } + + return words; + } + + public override string ToString() => Data.ToString(); + + public static implicit operator SPIRVWord(uint u) => new SPIRVWord(u); + } +} diff --git a/Src/ILGPU/Backends/SPIRV/Types/ISPIRVType.cs b/Src/ILGPU/Backends/SPIRV/Types/ISPIRVType.cs new file mode 100644 index 000000000..ff3aedab1 --- /dev/null +++ b/Src/ILGPU/Backends/SPIRV/Types/ISPIRVType.cs @@ -0,0 +1,20 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: ISPIRVType.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +namespace ILGPU.Backends.SPIRV.Types +{ + internal interface ISPIRVType + { + SPIRVWord[] ToWords(); + + string ToRepr(); + } +} diff --git a/Src/ILGPU/Backends/SPIRV/Types/SPIRVLiteralTypes.cs b/Src/ILGPU/Backends/SPIRV/Types/SPIRVLiteralTypes.cs new file mode 100644 index 000000000..7aebd6c9b --- /dev/null +++ b/Src/ILGPU/Backends/SPIRV/Types/SPIRVLiteralTypes.cs @@ -0,0 +1,114 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: SPIRVLiteralTypes.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using System; +using System.Globalization; +using System.Text; + +namespace ILGPU.Backends.SPIRV.Types +{ + internal readonly struct LiteralInteger : ISPIRVType + { + private readonly int _value; + + public LiteralInteger(int val) + { + _value = val; + } + + public SPIRVWord[] ToWords() => + new[] {SPIRVWord.FromBytes(BitConverter.GetBytes(_value))}; + + public string ToRepr() => _value.ToString(); + } + + internal readonly struct LiteralFloat : ISPIRVType + { + private readonly float _value; + + public LiteralFloat(float val) + { + _value = val; + } + + public SPIRVWord[] ToWords() => + new[] {SPIRVWord.FromBytes(BitConverter.GetBytes(_value))}; + + public string ToRepr() => _value.ToString(CultureInfo.InvariantCulture); + } + + internal readonly struct LiteralString : ISPIRVType + { + private readonly string _value; + + public LiteralString(string val) + { + _value = val + "\000"; + } + + public SPIRVWord[] ToWords() => + SPIRVWord.ManyFromBytes(Encoding.UTF8.GetBytes(_value)); + + public string ToRepr() => _value; + } + + internal readonly struct LiteralContextDependentNumber : ISPIRVType + { + private readonly LiteralFloat? _floatValue; + private readonly LiteralInteger? _intValue; + + public LiteralContextDependentNumber(LiteralFloat val) + { + _floatValue = val; + _intValue = null; + } + + public LiteralContextDependentNumber(LiteralInteger val) + { + _intValue = val; + _floatValue = null; + } + + public SPIRVWord[] ToWords() => _floatValue?.ToWords() ?? _intValue?.ToWords()!; + + public string ToRepr() => _floatValue?.ToRepr() ?? _intValue?.ToRepr()!; + } + + internal readonly struct LiteralExtInstInteger + { + private readonly uint _value; + + public LiteralExtInstInteger(uint val) + { + _value = val; + } + + public SPIRVWord[] ToWords() => + new[] {SPIRVWord.FromBytes(BitConverter.GetBytes(_value))}; + + public string ToRepr() => _value.ToString(); + } + + internal readonly struct LiteralSpecConstantOpInteger + { + private readonly uint _value; + + public LiteralSpecConstantOpInteger(uint val) + { + _value = val; + } + + public SPIRVWord[] ToWords() => + new[] {SPIRVWord.FromBytes(BitConverter.GetBytes(_value))}; + + public string ToRepr() => _value.ToString(); + } +} diff --git a/Src/ILGPU/Backends/SPIRV/Types/SPIRVTypes.cs b/Src/ILGPU/Backends/SPIRV/Types/SPIRVTypes.cs new file mode 100644 index 000000000..dedf86102 --- /dev/null +++ b/Src/ILGPU/Backends/SPIRV/Types/SPIRVTypes.cs @@ -0,0 +1,3830 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: SPIRVTypes.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; + +// disable: max_line_length + +namespace ILGPU.Backends.SPIRV.Types +{ + internal struct ImageOperands : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public ImageOperands(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly ImageOperands None = + new ImageOperands(0, "None"); + + public static readonly ImageOperands Bias = + new ImageOperands(1, "Bias"); + + public static readonly ImageOperands Lod = + new ImageOperands(2, "Lod"); + + public static readonly ImageOperands Grad = + new ImageOperands(4, "Grad"); + + public static readonly ImageOperands ConstOffset = + new ImageOperands(8, "ConstOffset"); + + public static readonly ImageOperands Offset = + new ImageOperands(16, "Offset"); + + public static readonly ImageOperands ConstOffsets = + new ImageOperands(32, "ConstOffsets"); + + public static readonly ImageOperands Sample = + new ImageOperands(64, "Sample"); + + public static readonly ImageOperands MinLod = + new ImageOperands(128, "MinLod"); + + public static readonly ImageOperands MakeTexelAvailable = + new ImageOperands(256, "MakeTexelAvailable"); + + public static readonly ImageOperands MakeTexelAvailableKHR = + new ImageOperands(256, "MakeTexelAvailableKHR"); + + public static readonly ImageOperands MakeTexelVisible = + new ImageOperands(512, "MakeTexelVisible"); + + public static readonly ImageOperands MakeTexelVisibleKHR = + new ImageOperands(512, "MakeTexelVisibleKHR"); + + public static readonly ImageOperands NonPrivateTexel = + new ImageOperands(1024, "NonPrivateTexel"); + + public static readonly ImageOperands NonPrivateTexelKHR = + new ImageOperands(1024, "NonPrivateTexelKHR"); + + public static readonly ImageOperands VolatileTexel = + new ImageOperands(2048, "VolatileTexel"); + + public static readonly ImageOperands VolatileTexelKHR = + new ImageOperands(2048, "VolatileTexelKHR"); + + public static readonly ImageOperands SignExtend = + new ImageOperands(4096, "SignExtend"); + + public static readonly ImageOperands ZeroExtend = + new ImageOperands(8192, "ZeroExtend"); + + public static readonly ImageOperands Nontemporal = + new ImageOperands(16384, "Nontemporal"); + + public static readonly ImageOperands Offsets = + new ImageOperands(65536, "Offsets"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct FPFastMathMode : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public FPFastMathMode(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly FPFastMathMode None = + new FPFastMathMode(0, "None"); + + public static readonly FPFastMathMode NotNaN = + new FPFastMathMode(1, "NotNaN"); + + public static readonly FPFastMathMode NotInf = + new FPFastMathMode(2, "NotInf"); + + public static readonly FPFastMathMode NSZ = + new FPFastMathMode(4, "NSZ"); + + public static readonly FPFastMathMode AllowRecip = + new FPFastMathMode(8, "AllowRecip"); + + public static readonly FPFastMathMode Fast = + new FPFastMathMode(16, "Fast"); + + public static readonly FPFastMathMode AllowContractFastINTEL = + new FPFastMathMode(65536, "AllowContractFastINTEL"); + + public static readonly FPFastMathMode AllowReassocINTEL = + new FPFastMathMode(131072, "AllowReassocINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct SelectionControl : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public SelectionControl(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly SelectionControl None = + new SelectionControl(0, "None"); + + public static readonly SelectionControl Flatten = + new SelectionControl(1, "Flatten"); + + public static readonly SelectionControl DontFlatten = + new SelectionControl(2, "DontFlatten"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct LoopControl : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public LoopControl(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly LoopControl None = + new LoopControl(0, "None"); + + public static readonly LoopControl Unroll = + new LoopControl(1, "Unroll"); + + public static readonly LoopControl DontUnroll = + new LoopControl(2, "DontUnroll"); + + public static readonly LoopControl DependencyInfinite = + new LoopControl(4, "DependencyInfinite"); + + public static readonly LoopControl DependencyLength = + new LoopControl(8, "DependencyLength"); + + public static readonly LoopControl MinIterations = + new LoopControl(16, "MinIterations"); + + public static readonly LoopControl MaxIterations = + new LoopControl(32, "MaxIterations"); + + public static readonly LoopControl IterationMultiple = + new LoopControl(64, "IterationMultiple"); + + public static readonly LoopControl PeelCount = + new LoopControl(128, "PeelCount"); + + public static readonly LoopControl PartialCount = + new LoopControl(256, "PartialCount"); + + public static readonly LoopControl InitiationIntervalINTEL = + new LoopControl(65536, "InitiationIntervalINTEL"); + + public static readonly LoopControl MaxConcurrencyINTEL = + new LoopControl(131072, "MaxConcurrencyINTEL"); + + public static readonly LoopControl DependencyArrayINTEL = + new LoopControl(262144, "DependencyArrayINTEL"); + + public static readonly LoopControl PipelineEnableINTEL = + new LoopControl(524288, "PipelineEnableINTEL"); + + public static readonly LoopControl LoopCoalesceINTEL = + new LoopControl(1048576, "LoopCoalesceINTEL"); + + public static readonly LoopControl MaxInterleavingINTEL = + new LoopControl(2097152, "MaxInterleavingINTEL"); + + public static readonly LoopControl SpeculatedIterationsINTEL = + new LoopControl(4194304, "SpeculatedIterationsINTEL"); + + public static readonly LoopControl NoFusionINTEL = + new LoopControl(8388608, "NoFusionINTEL"); + + public static readonly LoopControl LoopCountINTEL = + new LoopControl(16777216, "LoopCountINTEL"); + + public static readonly LoopControl MaxReinvocationDelayINTEL = + new LoopControl(33554432, "MaxReinvocationDelayINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct FunctionControl : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public FunctionControl(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly FunctionControl None = + new FunctionControl(0, "None"); + + public static readonly FunctionControl Inline = + new FunctionControl(1, "Inline"); + + public static readonly FunctionControl DontInline = + new FunctionControl(2, "DontInline"); + + public static readonly FunctionControl Pure = + new FunctionControl(4, "Pure"); + + public static readonly FunctionControl Const = + new FunctionControl(8, "Const"); + + public static readonly FunctionControl OptNoneINTEL = + new FunctionControl(65536, "OptNoneINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct MemorySemantics : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public MemorySemantics(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly MemorySemantics Relaxed = + new MemorySemantics(0, "Relaxed"); + + public static readonly MemorySemantics None = + new MemorySemantics(0, "None"); + + public static readonly MemorySemantics Acquire = + new MemorySemantics(2, "Acquire"); + + public static readonly MemorySemantics Release = + new MemorySemantics(4, "Release"); + + public static readonly MemorySemantics AcquireRelease = + new MemorySemantics(8, "AcquireRelease"); + + public static readonly MemorySemantics SequentiallyConsistent = + new MemorySemantics(16, "SequentiallyConsistent"); + + public static readonly MemorySemantics UniformMemory = + new MemorySemantics(64, "UniformMemory"); + + public static readonly MemorySemantics SubgroupMemory = + new MemorySemantics(128, "SubgroupMemory"); + + public static readonly MemorySemantics WorkgroupMemory = + new MemorySemantics(256, "WorkgroupMemory"); + + public static readonly MemorySemantics CrossWorkgroupMemory = + new MemorySemantics(512, "CrossWorkgroupMemory"); + + public static readonly MemorySemantics AtomicCounterMemory = + new MemorySemantics(1024, "AtomicCounterMemory"); + + public static readonly MemorySemantics ImageMemory = + new MemorySemantics(2048, "ImageMemory"); + + public static readonly MemorySemantics OutputMemory = + new MemorySemantics(4096, "OutputMemory"); + + public static readonly MemorySemantics OutputMemoryKHR = + new MemorySemantics(4096, "OutputMemoryKHR"); + + public static readonly MemorySemantics MakeAvailable = + new MemorySemantics(8192, "MakeAvailable"); + + public static readonly MemorySemantics MakeAvailableKHR = + new MemorySemantics(8192, "MakeAvailableKHR"); + + public static readonly MemorySemantics MakeVisible = + new MemorySemantics(16384, "MakeVisible"); + + public static readonly MemorySemantics MakeVisibleKHR = + new MemorySemantics(16384, "MakeVisibleKHR"); + + public static readonly MemorySemantics Volatile = + new MemorySemantics(32768, "Volatile"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct MemoryAccess : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public MemoryAccess(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly MemoryAccess None = + new MemoryAccess(0, "None"); + + public static readonly MemoryAccess Volatile = + new MemoryAccess(1, "Volatile"); + + public static readonly MemoryAccess Aligned = + new MemoryAccess(2, "Aligned"); + + public static readonly MemoryAccess Nontemporal = + new MemoryAccess(4, "Nontemporal"); + + public static readonly MemoryAccess MakePointerAvailable = + new MemoryAccess(8, "MakePointerAvailable"); + + public static readonly MemoryAccess MakePointerAvailableKHR = + new MemoryAccess(8, "MakePointerAvailableKHR"); + + public static readonly MemoryAccess MakePointerVisible = + new MemoryAccess(16, "MakePointerVisible"); + + public static readonly MemoryAccess MakePointerVisibleKHR = + new MemoryAccess(16, "MakePointerVisibleKHR"); + + public static readonly MemoryAccess NonPrivatePointer = + new MemoryAccess(32, "NonPrivatePointer"); + + public static readonly MemoryAccess NonPrivatePointerKHR = + new MemoryAccess(32, "NonPrivatePointerKHR"); + + public static readonly MemoryAccess AliasScopeINTELMask = + new MemoryAccess(65536, "AliasScopeINTELMask"); + + public static readonly MemoryAccess NoAliasINTELMask = + new MemoryAccess(131072, "NoAliasINTELMask"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct KernelProfilingInfo : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public KernelProfilingInfo(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly KernelProfilingInfo None = + new KernelProfilingInfo(0, "None"); + + public static readonly KernelProfilingInfo CmdExecTime = + new KernelProfilingInfo(1, "CmdExecTime"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct RayFlags : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public RayFlags(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly RayFlags NoneKHR = + new RayFlags(0, "NoneKHR"); + + public static readonly RayFlags OpaqueKHR = + new RayFlags(1, "OpaqueKHR"); + + public static readonly RayFlags NoOpaqueKHR = + new RayFlags(2, "NoOpaqueKHR"); + + public static readonly RayFlags TerminateOnFirstHitKHR = + new RayFlags(4, "TerminateOnFirstHitKHR"); + + public static readonly RayFlags SkipClosestHitShaderKHR = + new RayFlags(8, "SkipClosestHitShaderKHR"); + + public static readonly RayFlags CullBackFacingTrianglesKHR = + new RayFlags(16, "CullBackFacingTrianglesKHR"); + + public static readonly RayFlags CullFrontFacingTrianglesKHR = + new RayFlags(32, "CullFrontFacingTrianglesKHR"); + + public static readonly RayFlags CullOpaqueKHR = + new RayFlags(64, "CullOpaqueKHR"); + + public static readonly RayFlags CullNoOpaqueKHR = + new RayFlags(128, "CullNoOpaqueKHR"); + + public static readonly RayFlags SkipTrianglesKHR = + new RayFlags(256, "SkipTrianglesKHR"); + + public static readonly RayFlags SkipAABBsKHR = + new RayFlags(512, "SkipAABBsKHR"); + + public static readonly RayFlags ForceOpacityMicromap2StateEXT = + new RayFlags(1024, "ForceOpacityMicromap2StateEXT"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct FragmentShadingRate : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public FragmentShadingRate(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly FragmentShadingRate Vertical2Pixels = + new FragmentShadingRate(1, "Vertical2Pixels"); + + public static readonly FragmentShadingRate Vertical4Pixels = + new FragmentShadingRate(2, "Vertical4Pixels"); + + public static readonly FragmentShadingRate Horizontal2Pixels = + new FragmentShadingRate(4, "Horizontal2Pixels"); + + public static readonly FragmentShadingRate Horizontal4Pixels = + new FragmentShadingRate(8, "Horizontal4Pixels"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct SourceLanguage : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public SourceLanguage(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly SourceLanguage Unknown = + new SourceLanguage(0, "Unknown"); + + public static readonly SourceLanguage ESSL = + new SourceLanguage(1, "ESSL"); + + public static readonly SourceLanguage GLSL = + new SourceLanguage(2, "GLSL"); + + public static readonly SourceLanguage OpenCL_C = + new SourceLanguage(3, "OpenCL_C"); + + public static readonly SourceLanguage OpenCL_CPP = + new SourceLanguage(4, "OpenCL_CPP"); + + public static readonly SourceLanguage HLSL = + new SourceLanguage(5, "HLSL"); + + public static readonly SourceLanguage CPP_for_OpenCL = + new SourceLanguage(6, "CPP_for_OpenCL"); + + public static readonly SourceLanguage SYCL = + new SourceLanguage(7, "SYCL"); + + public static readonly SourceLanguage HERO_C = + new SourceLanguage(8, "HERO_C"); + + public static readonly SourceLanguage NZSL = + new SourceLanguage(9, "NZSL"); + + public static readonly SourceLanguage WGSL = + new SourceLanguage(10, "WGSL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct ExecutionModel : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public ExecutionModel(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly ExecutionModel Vertex = + new ExecutionModel(0, "Vertex"); + + public static readonly ExecutionModel TessellationControl = + new ExecutionModel(1, "TessellationControl"); + + public static readonly ExecutionModel TessellationEvaluation = + new ExecutionModel(2, "TessellationEvaluation"); + + public static readonly ExecutionModel Geometry = + new ExecutionModel(3, "Geometry"); + + public static readonly ExecutionModel Fragment = + new ExecutionModel(4, "Fragment"); + + public static readonly ExecutionModel GLCompute = + new ExecutionModel(5, "GLCompute"); + + public static readonly ExecutionModel Kernel = + new ExecutionModel(6, "Kernel"); + + public static readonly ExecutionModel TaskNV = + new ExecutionModel(5267, "TaskNV"); + + public static readonly ExecutionModel MeshNV = + new ExecutionModel(5268, "MeshNV"); + + public static readonly ExecutionModel RayGenerationNV = + new ExecutionModel(5313, "RayGenerationNV"); + + public static readonly ExecutionModel RayGenerationKHR = + new ExecutionModel(5313, "RayGenerationKHR"); + + public static readonly ExecutionModel IntersectionNV = + new ExecutionModel(5314, "IntersectionNV"); + + public static readonly ExecutionModel IntersectionKHR = + new ExecutionModel(5314, "IntersectionKHR"); + + public static readonly ExecutionModel AnyHitNV = + new ExecutionModel(5315, "AnyHitNV"); + + public static readonly ExecutionModel AnyHitKHR = + new ExecutionModel(5315, "AnyHitKHR"); + + public static readonly ExecutionModel ClosestHitNV = + new ExecutionModel(5316, "ClosestHitNV"); + + public static readonly ExecutionModel ClosestHitKHR = + new ExecutionModel(5316, "ClosestHitKHR"); + + public static readonly ExecutionModel MissNV = + new ExecutionModel(5317, "MissNV"); + + public static readonly ExecutionModel MissKHR = + new ExecutionModel(5317, "MissKHR"); + + public static readonly ExecutionModel CallableNV = + new ExecutionModel(5318, "CallableNV"); + + public static readonly ExecutionModel CallableKHR = + new ExecutionModel(5318, "CallableKHR"); + + public static readonly ExecutionModel TaskEXT = + new ExecutionModel(5364, "TaskEXT"); + + public static readonly ExecutionModel MeshEXT = + new ExecutionModel(5365, "MeshEXT"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct AddressingModel : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public AddressingModel(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly AddressingModel Logical = + new AddressingModel(0, "Logical"); + + public static readonly AddressingModel Physical32 = + new AddressingModel(1, "Physical32"); + + public static readonly AddressingModel Physical64 = + new AddressingModel(2, "Physical64"); + + public static readonly AddressingModel PhysicalStorageBuffer64 = + new AddressingModel(5348, "PhysicalStorageBuffer64"); + + public static readonly AddressingModel PhysicalStorageBuffer64EXT = + new AddressingModel(5348, "PhysicalStorageBuffer64EXT"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct MemoryModel : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public MemoryModel(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly MemoryModel Simple = + new MemoryModel(0, "Simple"); + + public static readonly MemoryModel GLSL450 = + new MemoryModel(1, "GLSL450"); + + public static readonly MemoryModel OpenCL = + new MemoryModel(2, "OpenCL"); + + public static readonly MemoryModel Vulkan = + new MemoryModel(3, "Vulkan"); + + public static readonly MemoryModel VulkanKHR = + new MemoryModel(3, "VulkanKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct ExecutionMode : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public ExecutionMode(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly ExecutionMode Invocations = + new ExecutionMode(0, "Invocations"); + + public static readonly ExecutionMode SpacingEqual = + new ExecutionMode(1, "SpacingEqual"); + + public static readonly ExecutionMode SpacingFractionalEven = + new ExecutionMode(2, "SpacingFractionalEven"); + + public static readonly ExecutionMode SpacingFractionalOdd = + new ExecutionMode(3, "SpacingFractionalOdd"); + + public static readonly ExecutionMode VertexOrderCw = + new ExecutionMode(4, "VertexOrderCw"); + + public static readonly ExecutionMode VertexOrderCcw = + new ExecutionMode(5, "VertexOrderCcw"); + + public static readonly ExecutionMode PixelCenterInteger = + new ExecutionMode(6, "PixelCenterInteger"); + + public static readonly ExecutionMode OriginUpperLeft = + new ExecutionMode(7, "OriginUpperLeft"); + + public static readonly ExecutionMode OriginLowerLeft = + new ExecutionMode(8, "OriginLowerLeft"); + + public static readonly ExecutionMode EarlyFragmentTests = + new ExecutionMode(9, "EarlyFragmentTests"); + + public static readonly ExecutionMode PointMode = + new ExecutionMode(10, "PointMode"); + + public static readonly ExecutionMode Xfb = + new ExecutionMode(11, "Xfb"); + + public static readonly ExecutionMode DepthReplacing = + new ExecutionMode(12, "DepthReplacing"); + + public static readonly ExecutionMode DepthGreater = + new ExecutionMode(14, "DepthGreater"); + + public static readonly ExecutionMode DepthLess = + new ExecutionMode(15, "DepthLess"); + + public static readonly ExecutionMode DepthUnchanged = + new ExecutionMode(16, "DepthUnchanged"); + + public static readonly ExecutionMode LocalSize = + new ExecutionMode(17, "LocalSize"); + + public static readonly ExecutionMode LocalSizeHint = + new ExecutionMode(18, "LocalSizeHint"); + + public static readonly ExecutionMode InputPoints = + new ExecutionMode(19, "InputPoints"); + + public static readonly ExecutionMode InputLines = + new ExecutionMode(20, "InputLines"); + + public static readonly ExecutionMode InputLinesAdjacency = + new ExecutionMode(21, "InputLinesAdjacency"); + + public static readonly ExecutionMode Triangles = + new ExecutionMode(22, "Triangles"); + + public static readonly ExecutionMode InputTrianglesAdjacency = + new ExecutionMode(23, "InputTrianglesAdjacency"); + + public static readonly ExecutionMode Quads = + new ExecutionMode(24, "Quads"); + + public static readonly ExecutionMode Isolines = + new ExecutionMode(25, "Isolines"); + + public static readonly ExecutionMode OutputVertices = + new ExecutionMode(26, "OutputVertices"); + + public static readonly ExecutionMode OutputPoints = + new ExecutionMode(27, "OutputPoints"); + + public static readonly ExecutionMode OutputLineStrip = + new ExecutionMode(28, "OutputLineStrip"); + + public static readonly ExecutionMode OutputTriangleStrip = + new ExecutionMode(29, "OutputTriangleStrip"); + + public static readonly ExecutionMode VecTypeHint = + new ExecutionMode(30, "VecTypeHint"); + + public static readonly ExecutionMode ContractionOff = + new ExecutionMode(31, "ContractionOff"); + + public static readonly ExecutionMode Initializer = + new ExecutionMode(33, "Initializer"); + + public static readonly ExecutionMode Finalizer = + new ExecutionMode(34, "Finalizer"); + + public static readonly ExecutionMode SubgroupSize = + new ExecutionMode(35, "SubgroupSize"); + + public static readonly ExecutionMode SubgroupsPerWorkgroup = + new ExecutionMode(36, "SubgroupsPerWorkgroup"); + + public static readonly ExecutionMode SubgroupsPerWorkgroupId = + new ExecutionMode(37, "SubgroupsPerWorkgroupId"); + + public static readonly ExecutionMode LocalSizeId = + new ExecutionMode(38, "LocalSizeId"); + + public static readonly ExecutionMode LocalSizeHintId = + new ExecutionMode(39, "LocalSizeHintId"); + + public static readonly ExecutionMode NonCoherentColorAttachmentReadEXT = + new ExecutionMode(4169, "NonCoherentColorAttachmentReadEXT"); + + public static readonly ExecutionMode NonCoherentDepthAttachmentReadEXT = + new ExecutionMode(4170, "NonCoherentDepthAttachmentReadEXT"); + + public static readonly ExecutionMode NonCoherentStencilAttachmentReadEXT = + new ExecutionMode(4171, "NonCoherentStencilAttachmentReadEXT"); + + public static readonly ExecutionMode SubgroupUniformControlFlowKHR = + new ExecutionMode(4421, "SubgroupUniformControlFlowKHR"); + + public static readonly ExecutionMode PostDepthCoverage = + new ExecutionMode(4446, "PostDepthCoverage"); + + public static readonly ExecutionMode DenormPreserve = + new ExecutionMode(4459, "DenormPreserve"); + + public static readonly ExecutionMode DenormFlushToZero = + new ExecutionMode(4460, "DenormFlushToZero"); + + public static readonly ExecutionMode SignedZeroInfNanPreserve = + new ExecutionMode(4461, "SignedZeroInfNanPreserve"); + + public static readonly ExecutionMode RoundingModeRTE = + new ExecutionMode(4462, "RoundingModeRTE"); + + public static readonly ExecutionMode RoundingModeRTZ = + new ExecutionMode(4463, "RoundingModeRTZ"); + + public static readonly ExecutionMode EarlyAndLateFragmentTestsAMD = + new ExecutionMode(5017, "EarlyAndLateFragmentTestsAMD"); + + public static readonly ExecutionMode StencilRefReplacingEXT = + new ExecutionMode(5027, "StencilRefReplacingEXT"); + + public static readonly ExecutionMode CoalescingAMDX = + new ExecutionMode(5069, "CoalescingAMDX"); + + public static readonly ExecutionMode MaxNodeRecursionAMDX = + new ExecutionMode(5071, "MaxNodeRecursionAMDX"); + + public static readonly ExecutionMode StaticNumWorkgroupsAMDX = + new ExecutionMode(5072, "StaticNumWorkgroupsAMDX"); + + public static readonly ExecutionMode ShaderIndexAMDX = + new ExecutionMode(5073, "ShaderIndexAMDX"); + + public static readonly ExecutionMode MaxNumWorkgroupsAMDX = + new ExecutionMode(5077, "MaxNumWorkgroupsAMDX"); + + public static readonly ExecutionMode StencilRefUnchangedFrontAMD = + new ExecutionMode(5079, "StencilRefUnchangedFrontAMD"); + + public static readonly ExecutionMode StencilRefGreaterFrontAMD = + new ExecutionMode(5080, "StencilRefGreaterFrontAMD"); + + public static readonly ExecutionMode StencilRefLessFrontAMD = + new ExecutionMode(5081, "StencilRefLessFrontAMD"); + + public static readonly ExecutionMode StencilRefUnchangedBackAMD = + new ExecutionMode(5082, "StencilRefUnchangedBackAMD"); + + public static readonly ExecutionMode StencilRefGreaterBackAMD = + new ExecutionMode(5083, "StencilRefGreaterBackAMD"); + + public static readonly ExecutionMode StencilRefLessBackAMD = + new ExecutionMode(5084, "StencilRefLessBackAMD"); + + public static readonly ExecutionMode OutputLinesNV = + new ExecutionMode(5269, "OutputLinesNV"); + + public static readonly ExecutionMode OutputLinesEXT = + new ExecutionMode(5269, "OutputLinesEXT"); + + public static readonly ExecutionMode OutputPrimitivesNV = + new ExecutionMode(5270, "OutputPrimitivesNV"); + + public static readonly ExecutionMode OutputPrimitivesEXT = + new ExecutionMode(5270, "OutputPrimitivesEXT"); + + public static readonly ExecutionMode DerivativeGroupQuadsNV = + new ExecutionMode(5289, "DerivativeGroupQuadsNV"); + + public static readonly ExecutionMode DerivativeGroupLinearNV = + new ExecutionMode(5290, "DerivativeGroupLinearNV"); + + public static readonly ExecutionMode OutputTrianglesNV = + new ExecutionMode(5298, "OutputTrianglesNV"); + + public static readonly ExecutionMode OutputTrianglesEXT = + new ExecutionMode(5298, "OutputTrianglesEXT"); + + public static readonly ExecutionMode PixelInterlockOrderedEXT = + new ExecutionMode(5366, "PixelInterlockOrderedEXT"); + + public static readonly ExecutionMode PixelInterlockUnorderedEXT = + new ExecutionMode(5367, "PixelInterlockUnorderedEXT"); + + public static readonly ExecutionMode SampleInterlockOrderedEXT = + new ExecutionMode(5368, "SampleInterlockOrderedEXT"); + + public static readonly ExecutionMode SampleInterlockUnorderedEXT = + new ExecutionMode(5369, "SampleInterlockUnorderedEXT"); + + public static readonly ExecutionMode ShadingRateInterlockOrderedEXT = + new ExecutionMode(5370, "ShadingRateInterlockOrderedEXT"); + + public static readonly ExecutionMode ShadingRateInterlockUnorderedEXT = + new ExecutionMode(5371, "ShadingRateInterlockUnorderedEXT"); + + public static readonly ExecutionMode SharedLocalMemorySizeINTEL = + new ExecutionMode(5618, "SharedLocalMemorySizeINTEL"); + + public static readonly ExecutionMode RoundingModeRTPINTEL = + new ExecutionMode(5620, "RoundingModeRTPINTEL"); + + public static readonly ExecutionMode RoundingModeRTNINTEL = + new ExecutionMode(5621, "RoundingModeRTNINTEL"); + + public static readonly ExecutionMode FloatingPointModeALTINTEL = + new ExecutionMode(5622, "FloatingPointModeALTINTEL"); + + public static readonly ExecutionMode FloatingPointModeIEEEINTEL = + new ExecutionMode(5623, "FloatingPointModeIEEEINTEL"); + + public static readonly ExecutionMode MaxWorkgroupSizeINTEL = + new ExecutionMode(5893, "MaxWorkgroupSizeINTEL"); + + public static readonly ExecutionMode MaxWorkDimINTEL = + new ExecutionMode(5894, "MaxWorkDimINTEL"); + + public static readonly ExecutionMode NoGlobalOffsetINTEL = + new ExecutionMode(5895, "NoGlobalOffsetINTEL"); + + public static readonly ExecutionMode NumSIMDWorkitemsINTEL = + new ExecutionMode(5896, "NumSIMDWorkitemsINTEL"); + + public static readonly ExecutionMode SchedulerTargetFmaxMhzINTEL = + new ExecutionMode(5903, "SchedulerTargetFmaxMhzINTEL"); + + public static readonly ExecutionMode StreamingInterfaceINTEL = + new ExecutionMode(6154, "StreamingInterfaceINTEL"); + + public static readonly ExecutionMode RegisterMapInterfaceINTEL = + new ExecutionMode(6160, "RegisterMapInterfaceINTEL"); + + public static readonly ExecutionMode NamedBarrierCountINTEL = + new ExecutionMode(6417, "NamedBarrierCountINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct StorageClass : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public StorageClass(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly StorageClass UniformConstant = + new StorageClass(0, "UniformConstant"); + + public static readonly StorageClass Input = + new StorageClass(1, "Input"); + + public static readonly StorageClass Uniform = + new StorageClass(2, "Uniform"); + + public static readonly StorageClass Output = + new StorageClass(3, "Output"); + + public static readonly StorageClass Workgroup = + new StorageClass(4, "Workgroup"); + + public static readonly StorageClass CrossWorkgroup = + new StorageClass(5, "CrossWorkgroup"); + + public static readonly StorageClass Private = + new StorageClass(6, "Private"); + + public static readonly StorageClass Function = + new StorageClass(7, "Function"); + + public static readonly StorageClass Generic = + new StorageClass(8, "Generic"); + + public static readonly StorageClass PushConstant = + new StorageClass(9, "PushConstant"); + + public static readonly StorageClass AtomicCounter = + new StorageClass(10, "AtomicCounter"); + + public static readonly StorageClass Image = + new StorageClass(11, "Image"); + + public static readonly StorageClass StorageBuffer = + new StorageClass(12, "StorageBuffer"); + + public static readonly StorageClass TileImageEXT = + new StorageClass(4172, "TileImageEXT"); + + public static readonly StorageClass NodePayloadAMDX = + new StorageClass(5068, "NodePayloadAMDX"); + + public static readonly StorageClass NodeOutputPayloadAMDX = + new StorageClass(5076, "NodeOutputPayloadAMDX"); + + public static readonly StorageClass CallableDataNV = + new StorageClass(5328, "CallableDataNV"); + + public static readonly StorageClass CallableDataKHR = + new StorageClass(5328, "CallableDataKHR"); + + public static readonly StorageClass IncomingCallableDataNV = + new StorageClass(5329, "IncomingCallableDataNV"); + + public static readonly StorageClass IncomingCallableDataKHR = + new StorageClass(5329, "IncomingCallableDataKHR"); + + public static readonly StorageClass RayPayloadNV = + new StorageClass(5338, "RayPayloadNV"); + + public static readonly StorageClass RayPayloadKHR = + new StorageClass(5338, "RayPayloadKHR"); + + public static readonly StorageClass HitAttributeNV = + new StorageClass(5339, "HitAttributeNV"); + + public static readonly StorageClass HitAttributeKHR = + new StorageClass(5339, "HitAttributeKHR"); + + public static readonly StorageClass IncomingRayPayloadNV = + new StorageClass(5342, "IncomingRayPayloadNV"); + + public static readonly StorageClass IncomingRayPayloadKHR = + new StorageClass(5342, "IncomingRayPayloadKHR"); + + public static readonly StorageClass ShaderRecordBufferNV = + new StorageClass(5343, "ShaderRecordBufferNV"); + + public static readonly StorageClass ShaderRecordBufferKHR = + new StorageClass(5343, "ShaderRecordBufferKHR"); + + public static readonly StorageClass PhysicalStorageBuffer = + new StorageClass(5349, "PhysicalStorageBuffer"); + + public static readonly StorageClass PhysicalStorageBufferEXT = + new StorageClass(5349, "PhysicalStorageBufferEXT"); + + public static readonly StorageClass HitObjectAttributeNV = + new StorageClass(5385, "HitObjectAttributeNV"); + + public static readonly StorageClass TaskPayloadWorkgroupEXT = + new StorageClass(5402, "TaskPayloadWorkgroupEXT"); + + public static readonly StorageClass CodeSectionINTEL = + new StorageClass(5605, "CodeSectionINTEL"); + + public static readonly StorageClass DeviceOnlyINTEL = + new StorageClass(5936, "DeviceOnlyINTEL"); + + public static readonly StorageClass HostOnlyINTEL = + new StorageClass(5937, "HostOnlyINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct Dim : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public Dim(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly Dim n1D = + new Dim(0, "n1D"); + + public static readonly Dim n2D = + new Dim(1, "n2D"); + + public static readonly Dim n3D = + new Dim(2, "n3D"); + + public static readonly Dim Cube = + new Dim(3, "Cube"); + + public static readonly Dim Rect = + new Dim(4, "Rect"); + + public static readonly Dim Buffer = + new Dim(5, "Buffer"); + + public static readonly Dim SubpassData = + new Dim(6, "SubpassData"); + + public static readonly Dim TileImageDataEXT = + new Dim(4173, "TileImageDataEXT"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct SamplerAddressingMode : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public SamplerAddressingMode(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly SamplerAddressingMode None = + new SamplerAddressingMode(0, "None"); + + public static readonly SamplerAddressingMode ClampToEdge = + new SamplerAddressingMode(1, "ClampToEdge"); + + public static readonly SamplerAddressingMode Clamp = + new SamplerAddressingMode(2, "Clamp"); + + public static readonly SamplerAddressingMode Repeat = + new SamplerAddressingMode(3, "Repeat"); + + public static readonly SamplerAddressingMode RepeatMirrored = + new SamplerAddressingMode(4, "RepeatMirrored"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct SamplerFilterMode : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public SamplerFilterMode(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly SamplerFilterMode Nearest = + new SamplerFilterMode(0, "Nearest"); + + public static readonly SamplerFilterMode Linear = + new SamplerFilterMode(1, "Linear"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct ImageFormat : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public ImageFormat(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly ImageFormat Unknown = + new ImageFormat(0, "Unknown"); + + public static readonly ImageFormat Rgba32f = + new ImageFormat(1, "Rgba32f"); + + public static readonly ImageFormat Rgba16f = + new ImageFormat(2, "Rgba16f"); + + public static readonly ImageFormat R32f = + new ImageFormat(3, "R32f"); + + public static readonly ImageFormat Rgba8 = + new ImageFormat(4, "Rgba8"); + + public static readonly ImageFormat Rgba8Snorm = + new ImageFormat(5, "Rgba8Snorm"); + + public static readonly ImageFormat Rg32f = + new ImageFormat(6, "Rg32f"); + + public static readonly ImageFormat Rg16f = + new ImageFormat(7, "Rg16f"); + + public static readonly ImageFormat R11fG11fB10f = + new ImageFormat(8, "R11fG11fB10f"); + + public static readonly ImageFormat R16f = + new ImageFormat(9, "R16f"); + + public static readonly ImageFormat Rgba16 = + new ImageFormat(10, "Rgba16"); + + public static readonly ImageFormat Rgb10A2 = + new ImageFormat(11, "Rgb10A2"); + + public static readonly ImageFormat Rg16 = + new ImageFormat(12, "Rg16"); + + public static readonly ImageFormat Rg8 = + new ImageFormat(13, "Rg8"); + + public static readonly ImageFormat R16 = + new ImageFormat(14, "R16"); + + public static readonly ImageFormat R8 = + new ImageFormat(15, "R8"); + + public static readonly ImageFormat Rgba16Snorm = + new ImageFormat(16, "Rgba16Snorm"); + + public static readonly ImageFormat Rg16Snorm = + new ImageFormat(17, "Rg16Snorm"); + + public static readonly ImageFormat Rg8Snorm = + new ImageFormat(18, "Rg8Snorm"); + + public static readonly ImageFormat R16Snorm = + new ImageFormat(19, "R16Snorm"); + + public static readonly ImageFormat R8Snorm = + new ImageFormat(20, "R8Snorm"); + + public static readonly ImageFormat Rgba32i = + new ImageFormat(21, "Rgba32i"); + + public static readonly ImageFormat Rgba16i = + new ImageFormat(22, "Rgba16i"); + + public static readonly ImageFormat Rgba8i = + new ImageFormat(23, "Rgba8i"); + + public static readonly ImageFormat R32i = + new ImageFormat(24, "R32i"); + + public static readonly ImageFormat Rg32i = + new ImageFormat(25, "Rg32i"); + + public static readonly ImageFormat Rg16i = + new ImageFormat(26, "Rg16i"); + + public static readonly ImageFormat Rg8i = + new ImageFormat(27, "Rg8i"); + + public static readonly ImageFormat R16i = + new ImageFormat(28, "R16i"); + + public static readonly ImageFormat R8i = + new ImageFormat(29, "R8i"); + + public static readonly ImageFormat Rgba32ui = + new ImageFormat(30, "Rgba32ui"); + + public static readonly ImageFormat Rgba16ui = + new ImageFormat(31, "Rgba16ui"); + + public static readonly ImageFormat Rgba8ui = + new ImageFormat(32, "Rgba8ui"); + + public static readonly ImageFormat R32ui = + new ImageFormat(33, "R32ui"); + + public static readonly ImageFormat Rgb10a2ui = + new ImageFormat(34, "Rgb10a2ui"); + + public static readonly ImageFormat Rg32ui = + new ImageFormat(35, "Rg32ui"); + + public static readonly ImageFormat Rg16ui = + new ImageFormat(36, "Rg16ui"); + + public static readonly ImageFormat Rg8ui = + new ImageFormat(37, "Rg8ui"); + + public static readonly ImageFormat R16ui = + new ImageFormat(38, "R16ui"); + + public static readonly ImageFormat R8ui = + new ImageFormat(39, "R8ui"); + + public static readonly ImageFormat R64ui = + new ImageFormat(40, "R64ui"); + + public static readonly ImageFormat R64i = + new ImageFormat(41, "R64i"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct ImageChannelOrder : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public ImageChannelOrder(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly ImageChannelOrder R = + new ImageChannelOrder(0, "R"); + + public static readonly ImageChannelOrder A = + new ImageChannelOrder(1, "A"); + + public static readonly ImageChannelOrder RG = + new ImageChannelOrder(2, "RG"); + + public static readonly ImageChannelOrder RA = + new ImageChannelOrder(3, "RA"); + + public static readonly ImageChannelOrder RGB = + new ImageChannelOrder(4, "RGB"); + + public static readonly ImageChannelOrder RGBA = + new ImageChannelOrder(5, "RGBA"); + + public static readonly ImageChannelOrder BGRA = + new ImageChannelOrder(6, "BGRA"); + + public static readonly ImageChannelOrder ARGB = + new ImageChannelOrder(7, "ARGB"); + + public static readonly ImageChannelOrder Intensity = + new ImageChannelOrder(8, "Intensity"); + + public static readonly ImageChannelOrder Luminance = + new ImageChannelOrder(9, "Luminance"); + + public static readonly ImageChannelOrder Rx = + new ImageChannelOrder(10, "Rx"); + + public static readonly ImageChannelOrder RGx = + new ImageChannelOrder(11, "RGx"); + + public static readonly ImageChannelOrder RGBx = + new ImageChannelOrder(12, "RGBx"); + + public static readonly ImageChannelOrder Depth = + new ImageChannelOrder(13, "Depth"); + + public static readonly ImageChannelOrder DepthStencil = + new ImageChannelOrder(14, "DepthStencil"); + + public static readonly ImageChannelOrder sRGB = + new ImageChannelOrder(15, "sRGB"); + + public static readonly ImageChannelOrder sRGBx = + new ImageChannelOrder(16, "sRGBx"); + + public static readonly ImageChannelOrder sRGBA = + new ImageChannelOrder(17, "sRGBA"); + + public static readonly ImageChannelOrder sBGRA = + new ImageChannelOrder(18, "sBGRA"); + + public static readonly ImageChannelOrder ABGR = + new ImageChannelOrder(19, "ABGR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct ImageChannelDataType : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public ImageChannelDataType(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly ImageChannelDataType SnormInt8 = + new ImageChannelDataType(0, "SnormInt8"); + + public static readonly ImageChannelDataType SnormInt16 = + new ImageChannelDataType(1, "SnormInt16"); + + public static readonly ImageChannelDataType UnormInt8 = + new ImageChannelDataType(2, "UnormInt8"); + + public static readonly ImageChannelDataType UnormInt16 = + new ImageChannelDataType(3, "UnormInt16"); + + public static readonly ImageChannelDataType UnormShort565 = + new ImageChannelDataType(4, "UnormShort565"); + + public static readonly ImageChannelDataType UnormShort555 = + new ImageChannelDataType(5, "UnormShort555"); + + public static readonly ImageChannelDataType UnormInt101010 = + new ImageChannelDataType(6, "UnormInt101010"); + + public static readonly ImageChannelDataType SignedInt8 = + new ImageChannelDataType(7, "SignedInt8"); + + public static readonly ImageChannelDataType SignedInt16 = + new ImageChannelDataType(8, "SignedInt16"); + + public static readonly ImageChannelDataType SignedInt32 = + new ImageChannelDataType(9, "SignedInt32"); + + public static readonly ImageChannelDataType UnsignedInt8 = + new ImageChannelDataType(10, "UnsignedInt8"); + + public static readonly ImageChannelDataType UnsignedInt16 = + new ImageChannelDataType(11, "UnsignedInt16"); + + public static readonly ImageChannelDataType UnsignedInt32 = + new ImageChannelDataType(12, "UnsignedInt32"); + + public static readonly ImageChannelDataType HalfFloat = + new ImageChannelDataType(13, "HalfFloat"); + + public static readonly ImageChannelDataType Float = + new ImageChannelDataType(14, "Float"); + + public static readonly ImageChannelDataType UnormInt24 = + new ImageChannelDataType(15, "UnormInt24"); + + public static readonly ImageChannelDataType UnormInt101010_2 = + new ImageChannelDataType(16, "UnormInt101010_2"); + + public static readonly ImageChannelDataType UnsignedIntRaw10EXT = + new ImageChannelDataType(19, "UnsignedIntRaw10EXT"); + + public static readonly ImageChannelDataType UnsignedIntRaw12EXT = + new ImageChannelDataType(20, "UnsignedIntRaw12EXT"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct FPRoundingMode : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public FPRoundingMode(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly FPRoundingMode RTE = + new FPRoundingMode(0, "RTE"); + + public static readonly FPRoundingMode RTZ = + new FPRoundingMode(1, "RTZ"); + + public static readonly FPRoundingMode RTP = + new FPRoundingMode(2, "RTP"); + + public static readonly FPRoundingMode RTN = + new FPRoundingMode(3, "RTN"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct FPDenormMode : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public FPDenormMode(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly FPDenormMode Preserve = + new FPDenormMode(0, "Preserve"); + + public static readonly FPDenormMode FlushToZero = + new FPDenormMode(1, "FlushToZero"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct QuantizationModes : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public QuantizationModes(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly QuantizationModes TRN = + new QuantizationModes(0, "TRN"); + + public static readonly QuantizationModes TRN_ZERO = + new QuantizationModes(1, "TRN_ZERO"); + + public static readonly QuantizationModes RND = + new QuantizationModes(2, "RND"); + + public static readonly QuantizationModes RND_ZERO = + new QuantizationModes(3, "RND_ZERO"); + + public static readonly QuantizationModes RND_INF = + new QuantizationModes(4, "RND_INF"); + + public static readonly QuantizationModes RND_MIN_INF = + new QuantizationModes(5, "RND_MIN_INF"); + + public static readonly QuantizationModes RND_CONV = + new QuantizationModes(6, "RND_CONV"); + + public static readonly QuantizationModes RND_CONV_ODD = + new QuantizationModes(7, "RND_CONV_ODD"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct FPOperationMode : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public FPOperationMode(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly FPOperationMode IEEE = + new FPOperationMode(0, "IEEE"); + + public static readonly FPOperationMode ALT = + new FPOperationMode(1, "ALT"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct OverflowModes : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public OverflowModes(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly OverflowModes WRAP = + new OverflowModes(0, "WRAP"); + + public static readonly OverflowModes SAT = + new OverflowModes(1, "SAT"); + + public static readonly OverflowModes SAT_ZERO = + new OverflowModes(2, "SAT_ZERO"); + + public static readonly OverflowModes SAT_SYM = + new OverflowModes(3, "SAT_SYM"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct LinkageType : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public LinkageType(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly LinkageType Export = + new LinkageType(0, "Export"); + + public static readonly LinkageType Import = + new LinkageType(1, "Import"); + + public static readonly LinkageType LinkOnceODR = + new LinkageType(2, "LinkOnceODR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct AccessQualifier : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public AccessQualifier(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly AccessQualifier ReadOnly = + new AccessQualifier(0, "ReadOnly"); + + public static readonly AccessQualifier WriteOnly = + new AccessQualifier(1, "WriteOnly"); + + public static readonly AccessQualifier ReadWrite = + new AccessQualifier(2, "ReadWrite"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct HostAccessQualifier : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public HostAccessQualifier(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly HostAccessQualifier NoneINTEL = + new HostAccessQualifier(0, "NoneINTEL"); + + public static readonly HostAccessQualifier ReadINTEL = + new HostAccessQualifier(1, "ReadINTEL"); + + public static readonly HostAccessQualifier WriteINTEL = + new HostAccessQualifier(2, "WriteINTEL"); + + public static readonly HostAccessQualifier ReadWriteINTEL = + new HostAccessQualifier(3, "ReadWriteINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct FunctionParameterAttribute : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public FunctionParameterAttribute(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly FunctionParameterAttribute Zext = + new FunctionParameterAttribute(0, "Zext"); + + public static readonly FunctionParameterAttribute Sext = + new FunctionParameterAttribute(1, "Sext"); + + public static readonly FunctionParameterAttribute ByVal = + new FunctionParameterAttribute(2, "ByVal"); + + public static readonly FunctionParameterAttribute Sret = + new FunctionParameterAttribute(3, "Sret"); + + public static readonly FunctionParameterAttribute NoAlias = + new FunctionParameterAttribute(4, "NoAlias"); + + public static readonly FunctionParameterAttribute NoCapture = + new FunctionParameterAttribute(5, "NoCapture"); + + public static readonly FunctionParameterAttribute NoWrite = + new FunctionParameterAttribute(6, "NoWrite"); + + public static readonly FunctionParameterAttribute NoReadWrite = + new FunctionParameterAttribute(7, "NoReadWrite"); + + public static readonly FunctionParameterAttribute RuntimeAlignedINTEL = + new FunctionParameterAttribute(5940, "RuntimeAlignedINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct Decoration : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public Decoration(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly Decoration RelaxedPrecision = + new Decoration(0, "RelaxedPrecision"); + + public static readonly Decoration SpecId = + new Decoration(1, "SpecId"); + + public static readonly Decoration Block = + new Decoration(2, "Block"); + + public static readonly Decoration BufferBlock = + new Decoration(3, "BufferBlock"); + + public static readonly Decoration RowMajor = + new Decoration(4, "RowMajor"); + + public static readonly Decoration ColMajor = + new Decoration(5, "ColMajor"); + + public static readonly Decoration ArrayStride = + new Decoration(6, "ArrayStride"); + + public static readonly Decoration MatrixStride = + new Decoration(7, "MatrixStride"); + + public static readonly Decoration GLSLShared = + new Decoration(8, "GLSLShared"); + + public static readonly Decoration GLSLPacked = + new Decoration(9, "GLSLPacked"); + + public static readonly Decoration CPacked = + new Decoration(10, "CPacked"); + + public static readonly Decoration BuiltIn = + new Decoration(11, "BuiltIn"); + + public static readonly Decoration NoPerspective = + new Decoration(13, "NoPerspective"); + + public static readonly Decoration Flat = + new Decoration(14, "Flat"); + + public static readonly Decoration Patch = + new Decoration(15, "Patch"); + + public static readonly Decoration Centroid = + new Decoration(16, "Centroid"); + + public static readonly Decoration Sample = + new Decoration(17, "Sample"); + + public static readonly Decoration Invariant = + new Decoration(18, "Invariant"); + + public static readonly Decoration Restrict = + new Decoration(19, "Restrict"); + + public static readonly Decoration Aliased = + new Decoration(20, "Aliased"); + + public static readonly Decoration Volatile = + new Decoration(21, "Volatile"); + + public static readonly Decoration Constant = + new Decoration(22, "Constant"); + + public static readonly Decoration Coherent = + new Decoration(23, "Coherent"); + + public static readonly Decoration NonWritable = + new Decoration(24, "NonWritable"); + + public static readonly Decoration NonReadable = + new Decoration(25, "NonReadable"); + + public static readonly Decoration Uniform = + new Decoration(26, "Uniform"); + + public static readonly Decoration UniformId = + new Decoration(27, "UniformId"); + + public static readonly Decoration SaturatedConversion = + new Decoration(28, "SaturatedConversion"); + + public static readonly Decoration Stream = + new Decoration(29, "Stream"); + + public static readonly Decoration Location = + new Decoration(30, "Location"); + + public static readonly Decoration Component = + new Decoration(31, "Component"); + + public static readonly Decoration Index = + new Decoration(32, "Index"); + + public static readonly Decoration Binding = + new Decoration(33, "Binding"); + + public static readonly Decoration DescriptorSet = + new Decoration(34, "DescriptorSet"); + + public static readonly Decoration Offset = + new Decoration(35, "Offset"); + + public static readonly Decoration XfbBuffer = + new Decoration(36, "XfbBuffer"); + + public static readonly Decoration XfbStride = + new Decoration(37, "XfbStride"); + + public static readonly Decoration FuncParamAttr = + new Decoration(38, "FuncParamAttr"); + + public static readonly Decoration FPRoundingMode = + new Decoration(39, "FPRoundingMode"); + + public static readonly Decoration FPFastMathMode = + new Decoration(40, "FPFastMathMode"); + + public static readonly Decoration LinkageAttributes = + new Decoration(41, "LinkageAttributes"); + + public static readonly Decoration NoContraction = + new Decoration(42, "NoContraction"); + + public static readonly Decoration InputAttachmentIndex = + new Decoration(43, "InputAttachmentIndex"); + + public static readonly Decoration Alignment = + new Decoration(44, "Alignment"); + + public static readonly Decoration MaxByteOffset = + new Decoration(45, "MaxByteOffset"); + + public static readonly Decoration AlignmentId = + new Decoration(46, "AlignmentId"); + + public static readonly Decoration MaxByteOffsetId = + new Decoration(47, "MaxByteOffsetId"); + + public static readonly Decoration NoSignedWrap = + new Decoration(4469, "NoSignedWrap"); + + public static readonly Decoration NoUnsignedWrap = + new Decoration(4470, "NoUnsignedWrap"); + + public static readonly Decoration WeightTextureQCOM = + new Decoration(4487, "WeightTextureQCOM"); + + public static readonly Decoration BlockMatchTextureQCOM = + new Decoration(4488, "BlockMatchTextureQCOM"); + + public static readonly Decoration ExplicitInterpAMD = + new Decoration(4999, "ExplicitInterpAMD"); + + public static readonly Decoration NodeSharesPayloadLimitsWithAMDX = + new Decoration(5019, "NodeSharesPayloadLimitsWithAMDX"); + + public static readonly Decoration NodeMaxPayloadsAMDX = + new Decoration(5020, "NodeMaxPayloadsAMDX"); + + public static readonly Decoration TrackFinishWritingAMDX = + new Decoration(5078, "TrackFinishWritingAMDX"); + + public static readonly Decoration PayloadNodeNameAMDX = + new Decoration(5091, "PayloadNodeNameAMDX"); + + public static readonly Decoration OverrideCoverageNV = + new Decoration(5248, "OverrideCoverageNV"); + + public static readonly Decoration PassthroughNV = + new Decoration(5250, "PassthroughNV"); + + public static readonly Decoration ViewportRelativeNV = + new Decoration(5252, "ViewportRelativeNV"); + + public static readonly Decoration SecondaryViewportRelativeNV = + new Decoration(5256, "SecondaryViewportRelativeNV"); + + public static readonly Decoration PerPrimitiveNV = + new Decoration(5271, "PerPrimitiveNV"); + + public static readonly Decoration PerPrimitiveEXT = + new Decoration(5271, "PerPrimitiveEXT"); + + public static readonly Decoration PerViewNV = + new Decoration(5272, "PerViewNV"); + + public static readonly Decoration PerTaskNV = + new Decoration(5273, "PerTaskNV"); + + public static readonly Decoration PerVertexKHR = + new Decoration(5285, "PerVertexKHR"); + + public static readonly Decoration PerVertexNV = + new Decoration(5285, "PerVertexNV"); + + public static readonly Decoration NonUniform = + new Decoration(5300, "NonUniform"); + + public static readonly Decoration NonUniformEXT = + new Decoration(5300, "NonUniformEXT"); + + public static readonly Decoration RestrictPointer = + new Decoration(5355, "RestrictPointer"); + + public static readonly Decoration RestrictPointerEXT = + new Decoration(5355, "RestrictPointerEXT"); + + public static readonly Decoration AliasedPointer = + new Decoration(5356, "AliasedPointer"); + + public static readonly Decoration AliasedPointerEXT = + new Decoration(5356, "AliasedPointerEXT"); + + public static readonly Decoration HitObjectShaderRecordBufferNV = + new Decoration(5386, "HitObjectShaderRecordBufferNV"); + + public static readonly Decoration BindlessSamplerNV = + new Decoration(5398, "BindlessSamplerNV"); + + public static readonly Decoration BindlessImageNV = + new Decoration(5399, "BindlessImageNV"); + + public static readonly Decoration BoundSamplerNV = + new Decoration(5400, "BoundSamplerNV"); + + public static readonly Decoration BoundImageNV = + new Decoration(5401, "BoundImageNV"); + + public static readonly Decoration SIMTCallINTEL = + new Decoration(5599, "SIMTCallINTEL"); + + public static readonly Decoration ReferencedIndirectlyINTEL = + new Decoration(5602, "ReferencedIndirectlyINTEL"); + + public static readonly Decoration ClobberINTEL = + new Decoration(5607, "ClobberINTEL"); + + public static readonly Decoration SideEffectsINTEL = + new Decoration(5608, "SideEffectsINTEL"); + + public static readonly Decoration VectorComputeVariableINTEL = + new Decoration(5624, "VectorComputeVariableINTEL"); + + public static readonly Decoration FuncParamIOKindINTEL = + new Decoration(5625, "FuncParamIOKindINTEL"); + + public static readonly Decoration VectorComputeFunctionINTEL = + new Decoration(5626, "VectorComputeFunctionINTEL"); + + public static readonly Decoration StackCallINTEL = + new Decoration(5627, "StackCallINTEL"); + + public static readonly Decoration GlobalVariableOffsetINTEL = + new Decoration(5628, "GlobalVariableOffsetINTEL"); + + public static readonly Decoration CounterBuffer = + new Decoration(5634, "CounterBuffer"); + + public static readonly Decoration HlslCounterBufferGOOGLE = + new Decoration(5634, "HlslCounterBufferGOOGLE"); + + public static readonly Decoration UserSemantic = + new Decoration(5635, "UserSemantic"); + + public static readonly Decoration HlslSemanticGOOGLE = + new Decoration(5635, "HlslSemanticGOOGLE"); + + public static readonly Decoration UserTypeGOOGLE = + new Decoration(5636, "UserTypeGOOGLE"); + + public static readonly Decoration FunctionRoundingModeINTEL = + new Decoration(5822, "FunctionRoundingModeINTEL"); + + public static readonly Decoration FunctionDenormModeINTEL = + new Decoration(5823, "FunctionDenormModeINTEL"); + + public static readonly Decoration RegisterINTEL = + new Decoration(5825, "RegisterINTEL"); + + public static readonly Decoration MemoryINTEL = + new Decoration(5826, "MemoryINTEL"); + + public static readonly Decoration NumbanksINTEL = + new Decoration(5827, "NumbanksINTEL"); + + public static readonly Decoration BankwidthINTEL = + new Decoration(5828, "BankwidthINTEL"); + + public static readonly Decoration MaxPrivateCopiesINTEL = + new Decoration(5829, "MaxPrivateCopiesINTEL"); + + public static readonly Decoration SinglepumpINTEL = + new Decoration(5830, "SinglepumpINTEL"); + + public static readonly Decoration DoublepumpINTEL = + new Decoration(5831, "DoublepumpINTEL"); + + public static readonly Decoration MaxReplicatesINTEL = + new Decoration(5832, "MaxReplicatesINTEL"); + + public static readonly Decoration SimpleDualPortINTEL = + new Decoration(5833, "SimpleDualPortINTEL"); + + public static readonly Decoration MergeINTEL = + new Decoration(5834, "MergeINTEL"); + + public static readonly Decoration BankBitsINTEL = + new Decoration(5835, "BankBitsINTEL"); + + public static readonly Decoration ForcePow2DepthINTEL = + new Decoration(5836, "ForcePow2DepthINTEL"); + + public static readonly Decoration BurstCoalesceINTEL = + new Decoration(5899, "BurstCoalesceINTEL"); + + public static readonly Decoration CacheSizeINTEL = + new Decoration(5900, "CacheSizeINTEL"); + + public static readonly Decoration DontStaticallyCoalesceINTEL = + new Decoration(5901, "DontStaticallyCoalesceINTEL"); + + public static readonly Decoration PrefetchINTEL = + new Decoration(5902, "PrefetchINTEL"); + + public static readonly Decoration StallEnableINTEL = + new Decoration(5905, "StallEnableINTEL"); + + public static readonly Decoration FuseLoopsInFunctionINTEL = + new Decoration(5907, "FuseLoopsInFunctionINTEL"); + + public static readonly Decoration MathOpDSPModeINTEL = + new Decoration(5909, "MathOpDSPModeINTEL"); + + public static readonly Decoration AliasScopeINTEL = + new Decoration(5914, "AliasScopeINTEL"); + + public static readonly Decoration NoAliasINTEL = + new Decoration(5915, "NoAliasINTEL"); + + public static readonly Decoration InitiationIntervalINTEL = + new Decoration(5917, "InitiationIntervalINTEL"); + + public static readonly Decoration MaxConcurrencyINTEL = + new Decoration(5918, "MaxConcurrencyINTEL"); + + public static readonly Decoration PipelineEnableINTEL = + new Decoration(5919, "PipelineEnableINTEL"); + + public static readonly Decoration BufferLocationINTEL = + new Decoration(5921, "BufferLocationINTEL"); + + public static readonly Decoration IOPipeStorageINTEL = + new Decoration(5944, "IOPipeStorageINTEL"); + + public static readonly Decoration FunctionFloatingPointModeINTEL = + new Decoration(6080, "FunctionFloatingPointModeINTEL"); + + public static readonly Decoration SingleElementVectorINTEL = + new Decoration(6085, "SingleElementVectorINTEL"); + + public static readonly Decoration VectorComputeCallableFunctionINTEL = + new Decoration(6087, "VectorComputeCallableFunctionINTEL"); + + public static readonly Decoration MediaBlockIOINTEL = + new Decoration(6140, "MediaBlockIOINTEL"); + + public static readonly Decoration InitModeINTEL = + new Decoration(6147, "InitModeINTEL"); + + public static readonly Decoration ImplementInRegisterMapINTEL = + new Decoration(6148, "ImplementInRegisterMapINTEL"); + + public static readonly Decoration HostAccessINTEL = + new Decoration(6168, "HostAccessINTEL"); + + public static readonly Decoration FPMaxErrorDecorationINTEL = + new Decoration(6170, "FPMaxErrorDecorationINTEL"); + + public static readonly Decoration LatencyControlLabelINTEL = + new Decoration(6172, "LatencyControlLabelINTEL"); + + public static readonly Decoration LatencyControlConstraintINTEL = + new Decoration(6173, "LatencyControlConstraintINTEL"); + + public static readonly Decoration ConduitKernelArgumentINTEL = + new Decoration(6175, "ConduitKernelArgumentINTEL"); + + public static readonly Decoration RegisterMapKernelArgumentINTEL = + new Decoration(6176, "RegisterMapKernelArgumentINTEL"); + + public static readonly Decoration MMHostInterfaceAddressWidthINTEL = + new Decoration(6177, "MMHostInterfaceAddressWidthINTEL"); + + public static readonly Decoration MMHostInterfaceDataWidthINTEL = + new Decoration(6178, "MMHostInterfaceDataWidthINTEL"); + + public static readonly Decoration MMHostInterfaceLatencyINTEL = + new Decoration(6179, "MMHostInterfaceLatencyINTEL"); + + public static readonly Decoration MMHostInterfaceReadWriteModeINTEL = + new Decoration(6180, "MMHostInterfaceReadWriteModeINTEL"); + + public static readonly Decoration MMHostInterfaceMaxBurstINTEL = + new Decoration(6181, "MMHostInterfaceMaxBurstINTEL"); + + public static readonly Decoration MMHostInterfaceWaitRequestINTEL = + new Decoration(6182, "MMHostInterfaceWaitRequestINTEL"); + + public static readonly Decoration StableKernelArgumentINTEL = + new Decoration(6183, "StableKernelArgumentINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct BuiltIn : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public BuiltIn(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly BuiltIn Position = + new BuiltIn(0, "Position"); + + public static readonly BuiltIn PointSize = + new BuiltIn(1, "PointSize"); + + public static readonly BuiltIn ClipDistance = + new BuiltIn(3, "ClipDistance"); + + public static readonly BuiltIn CullDistance = + new BuiltIn(4, "CullDistance"); + + public static readonly BuiltIn VertexId = + new BuiltIn(5, "VertexId"); + + public static readonly BuiltIn InstanceId = + new BuiltIn(6, "InstanceId"); + + public static readonly BuiltIn PrimitiveId = + new BuiltIn(7, "PrimitiveId"); + + public static readonly BuiltIn InvocationId = + new BuiltIn(8, "InvocationId"); + + public static readonly BuiltIn Layer = + new BuiltIn(9, "Layer"); + + public static readonly BuiltIn ViewportIndex = + new BuiltIn(10, "ViewportIndex"); + + public static readonly BuiltIn TessLevelOuter = + new BuiltIn(11, "TessLevelOuter"); + + public static readonly BuiltIn TessLevelInner = + new BuiltIn(12, "TessLevelInner"); + + public static readonly BuiltIn TessCoord = + new BuiltIn(13, "TessCoord"); + + public static readonly BuiltIn PatchVertices = + new BuiltIn(14, "PatchVertices"); + + public static readonly BuiltIn FragCoord = + new BuiltIn(15, "FragCoord"); + + public static readonly BuiltIn PointCoord = + new BuiltIn(16, "PointCoord"); + + public static readonly BuiltIn FrontFacing = + new BuiltIn(17, "FrontFacing"); + + public static readonly BuiltIn SampleId = + new BuiltIn(18, "SampleId"); + + public static readonly BuiltIn SamplePosition = + new BuiltIn(19, "SamplePosition"); + + public static readonly BuiltIn SampleMask = + new BuiltIn(20, "SampleMask"); + + public static readonly BuiltIn FragDepth = + new BuiltIn(22, "FragDepth"); + + public static readonly BuiltIn HelperInvocation = + new BuiltIn(23, "HelperInvocation"); + + public static readonly BuiltIn NumWorkgroups = + new BuiltIn(24, "NumWorkgroups"); + + public static readonly BuiltIn WorkgroupSize = + new BuiltIn(25, "WorkgroupSize"); + + public static readonly BuiltIn WorkgroupId = + new BuiltIn(26, "WorkgroupId"); + + public static readonly BuiltIn LocalInvocationId = + new BuiltIn(27, "LocalInvocationId"); + + public static readonly BuiltIn GlobalInvocationId = + new BuiltIn(28, "GlobalInvocationId"); + + public static readonly BuiltIn LocalInvocationIndex = + new BuiltIn(29, "LocalInvocationIndex"); + + public static readonly BuiltIn WorkDim = + new BuiltIn(30, "WorkDim"); + + public static readonly BuiltIn GlobalSize = + new BuiltIn(31, "GlobalSize"); + + public static readonly BuiltIn EnqueuedWorkgroupSize = + new BuiltIn(32, "EnqueuedWorkgroupSize"); + + public static readonly BuiltIn GlobalOffset = + new BuiltIn(33, "GlobalOffset"); + + public static readonly BuiltIn GlobalLinearId = + new BuiltIn(34, "GlobalLinearId"); + + public static readonly BuiltIn SubgroupSize = + new BuiltIn(36, "SubgroupSize"); + + public static readonly BuiltIn SubgroupMaxSize = + new BuiltIn(37, "SubgroupMaxSize"); + + public static readonly BuiltIn NumSubgroups = + new BuiltIn(38, "NumSubgroups"); + + public static readonly BuiltIn NumEnqueuedSubgroups = + new BuiltIn(39, "NumEnqueuedSubgroups"); + + public static readonly BuiltIn SubgroupId = + new BuiltIn(40, "SubgroupId"); + + public static readonly BuiltIn SubgroupLocalInvocationId = + new BuiltIn(41, "SubgroupLocalInvocationId"); + + public static readonly BuiltIn VertexIndex = + new BuiltIn(42, "VertexIndex"); + + public static readonly BuiltIn InstanceIndex = + new BuiltIn(43, "InstanceIndex"); + + public static readonly BuiltIn CoreIDARM = + new BuiltIn(4160, "CoreIDARM"); + + public static readonly BuiltIn CoreCountARM = + new BuiltIn(4161, "CoreCountARM"); + + public static readonly BuiltIn CoreMaxIDARM = + new BuiltIn(4162, "CoreMaxIDARM"); + + public static readonly BuiltIn WarpIDARM = + new BuiltIn(4163, "WarpIDARM"); + + public static readonly BuiltIn WarpMaxIDARM = + new BuiltIn(4164, "WarpMaxIDARM"); + + public static readonly BuiltIn SubgroupEqMask = + new BuiltIn(4416, "SubgroupEqMask"); + + public static readonly BuiltIn SubgroupEqMaskKHR = + new BuiltIn(4416, "SubgroupEqMaskKHR"); + + public static readonly BuiltIn SubgroupGeMask = + new BuiltIn(4417, "SubgroupGeMask"); + + public static readonly BuiltIn SubgroupGeMaskKHR = + new BuiltIn(4417, "SubgroupGeMaskKHR"); + + public static readonly BuiltIn SubgroupGtMask = + new BuiltIn(4418, "SubgroupGtMask"); + + public static readonly BuiltIn SubgroupGtMaskKHR = + new BuiltIn(4418, "SubgroupGtMaskKHR"); + + public static readonly BuiltIn SubgroupLeMask = + new BuiltIn(4419, "SubgroupLeMask"); + + public static readonly BuiltIn SubgroupLeMaskKHR = + new BuiltIn(4419, "SubgroupLeMaskKHR"); + + public static readonly BuiltIn SubgroupLtMask = + new BuiltIn(4420, "SubgroupLtMask"); + + public static readonly BuiltIn SubgroupLtMaskKHR = + new BuiltIn(4420, "SubgroupLtMaskKHR"); + + public static readonly BuiltIn BaseVertex = + new BuiltIn(4424, "BaseVertex"); + + public static readonly BuiltIn BaseInstance = + new BuiltIn(4425, "BaseInstance"); + + public static readonly BuiltIn DrawIndex = + new BuiltIn(4426, "DrawIndex"); + + public static readonly BuiltIn PrimitiveShadingRateKHR = + new BuiltIn(4432, "PrimitiveShadingRateKHR"); + + public static readonly BuiltIn DeviceIndex = + new BuiltIn(4438, "DeviceIndex"); + + public static readonly BuiltIn ViewIndex = + new BuiltIn(4440, "ViewIndex"); + + public static readonly BuiltIn ShadingRateKHR = + new BuiltIn(4444, "ShadingRateKHR"); + + public static readonly BuiltIn BaryCoordNoPerspAMD = + new BuiltIn(4992, "BaryCoordNoPerspAMD"); + + public static readonly BuiltIn BaryCoordNoPerspCentroidAMD = + new BuiltIn(4993, "BaryCoordNoPerspCentroidAMD"); + + public static readonly BuiltIn BaryCoordNoPerspSampleAMD = + new BuiltIn(4994, "BaryCoordNoPerspSampleAMD"); + + public static readonly BuiltIn BaryCoordSmoothAMD = + new BuiltIn(4995, "BaryCoordSmoothAMD"); + + public static readonly BuiltIn BaryCoordSmoothCentroidAMD = + new BuiltIn(4996, "BaryCoordSmoothCentroidAMD"); + + public static readonly BuiltIn BaryCoordSmoothSampleAMD = + new BuiltIn(4997, "BaryCoordSmoothSampleAMD"); + + public static readonly BuiltIn BaryCoordPullModelAMD = + new BuiltIn(4998, "BaryCoordPullModelAMD"); + + public static readonly BuiltIn FragStencilRefEXT = + new BuiltIn(5014, "FragStencilRefEXT"); + + public static readonly BuiltIn CoalescedInputCountAMDX = + new BuiltIn(5021, "CoalescedInputCountAMDX"); + + public static readonly BuiltIn ShaderIndexAMDX = + new BuiltIn(5073, "ShaderIndexAMDX"); + + public static readonly BuiltIn ViewportMaskNV = + new BuiltIn(5253, "ViewportMaskNV"); + + public static readonly BuiltIn SecondaryPositionNV = + new BuiltIn(5257, "SecondaryPositionNV"); + + public static readonly BuiltIn SecondaryViewportMaskNV = + new BuiltIn(5258, "SecondaryViewportMaskNV"); + + public static readonly BuiltIn PositionPerViewNV = + new BuiltIn(5261, "PositionPerViewNV"); + + public static readonly BuiltIn ViewportMaskPerViewNV = + new BuiltIn(5262, "ViewportMaskPerViewNV"); + + public static readonly BuiltIn FullyCoveredEXT = + new BuiltIn(5264, "FullyCoveredEXT"); + + public static readonly BuiltIn TaskCountNV = + new BuiltIn(5274, "TaskCountNV"); + + public static readonly BuiltIn PrimitiveCountNV = + new BuiltIn(5275, "PrimitiveCountNV"); + + public static readonly BuiltIn PrimitiveIndicesNV = + new BuiltIn(5276, "PrimitiveIndicesNV"); + + public static readonly BuiltIn ClipDistancePerViewNV = + new BuiltIn(5277, "ClipDistancePerViewNV"); + + public static readonly BuiltIn CullDistancePerViewNV = + new BuiltIn(5278, "CullDistancePerViewNV"); + + public static readonly BuiltIn LayerPerViewNV = + new BuiltIn(5279, "LayerPerViewNV"); + + public static readonly BuiltIn MeshViewCountNV = + new BuiltIn(5280, "MeshViewCountNV"); + + public static readonly BuiltIn MeshViewIndicesNV = + new BuiltIn(5281, "MeshViewIndicesNV"); + + public static readonly BuiltIn BaryCoordKHR = + new BuiltIn(5286, "BaryCoordKHR"); + + public static readonly BuiltIn BaryCoordNV = + new BuiltIn(5286, "BaryCoordNV"); + + public static readonly BuiltIn BaryCoordNoPerspKHR = + new BuiltIn(5287, "BaryCoordNoPerspKHR"); + + public static readonly BuiltIn BaryCoordNoPerspNV = + new BuiltIn(5287, "BaryCoordNoPerspNV"); + + public static readonly BuiltIn FragSizeEXT = + new BuiltIn(5292, "FragSizeEXT"); + + public static readonly BuiltIn FragmentSizeNV = + new BuiltIn(5292, "FragmentSizeNV"); + + public static readonly BuiltIn FragInvocationCountEXT = + new BuiltIn(5293, "FragInvocationCountEXT"); + + public static readonly BuiltIn InvocationsPerPixelNV = + new BuiltIn(5293, "InvocationsPerPixelNV"); + + public static readonly BuiltIn PrimitivePointIndicesEXT = + new BuiltIn(5294, "PrimitivePointIndicesEXT"); + + public static readonly BuiltIn PrimitiveLineIndicesEXT = + new BuiltIn(5295, "PrimitiveLineIndicesEXT"); + + public static readonly BuiltIn PrimitiveTriangleIndicesEXT = + new BuiltIn(5296, "PrimitiveTriangleIndicesEXT"); + + public static readonly BuiltIn CullPrimitiveEXT = + new BuiltIn(5299, "CullPrimitiveEXT"); + + public static readonly BuiltIn LaunchIdNV = + new BuiltIn(5319, "LaunchIdNV"); + + public static readonly BuiltIn LaunchIdKHR = + new BuiltIn(5319, "LaunchIdKHR"); + + public static readonly BuiltIn LaunchSizeNV = + new BuiltIn(5320, "LaunchSizeNV"); + + public static readonly BuiltIn LaunchSizeKHR = + new BuiltIn(5320, "LaunchSizeKHR"); + + public static readonly BuiltIn WorldRayOriginNV = + new BuiltIn(5321, "WorldRayOriginNV"); + + public static readonly BuiltIn WorldRayOriginKHR = + new BuiltIn(5321, "WorldRayOriginKHR"); + + public static readonly BuiltIn WorldRayDirectionNV = + new BuiltIn(5322, "WorldRayDirectionNV"); + + public static readonly BuiltIn WorldRayDirectionKHR = + new BuiltIn(5322, "WorldRayDirectionKHR"); + + public static readonly BuiltIn ObjectRayOriginNV = + new BuiltIn(5323, "ObjectRayOriginNV"); + + public static readonly BuiltIn ObjectRayOriginKHR = + new BuiltIn(5323, "ObjectRayOriginKHR"); + + public static readonly BuiltIn ObjectRayDirectionNV = + new BuiltIn(5324, "ObjectRayDirectionNV"); + + public static readonly BuiltIn ObjectRayDirectionKHR = + new BuiltIn(5324, "ObjectRayDirectionKHR"); + + public static readonly BuiltIn RayTminNV = + new BuiltIn(5325, "RayTminNV"); + + public static readonly BuiltIn RayTminKHR = + new BuiltIn(5325, "RayTminKHR"); + + public static readonly BuiltIn RayTmaxNV = + new BuiltIn(5326, "RayTmaxNV"); + + public static readonly BuiltIn RayTmaxKHR = + new BuiltIn(5326, "RayTmaxKHR"); + + public static readonly BuiltIn InstanceCustomIndexNV = + new BuiltIn(5327, "InstanceCustomIndexNV"); + + public static readonly BuiltIn InstanceCustomIndexKHR = + new BuiltIn(5327, "InstanceCustomIndexKHR"); + + public static readonly BuiltIn ObjectToWorldNV = + new BuiltIn(5330, "ObjectToWorldNV"); + + public static readonly BuiltIn ObjectToWorldKHR = + new BuiltIn(5330, "ObjectToWorldKHR"); + + public static readonly BuiltIn WorldToObjectNV = + new BuiltIn(5331, "WorldToObjectNV"); + + public static readonly BuiltIn WorldToObjectKHR = + new BuiltIn(5331, "WorldToObjectKHR"); + + public static readonly BuiltIn HitTNV = + new BuiltIn(5332, "HitTNV"); + + public static readonly BuiltIn HitKindNV = + new BuiltIn(5333, "HitKindNV"); + + public static readonly BuiltIn HitKindKHR = + new BuiltIn(5333, "HitKindKHR"); + + public static readonly BuiltIn CurrentRayTimeNV = + new BuiltIn(5334, "CurrentRayTimeNV"); + + public static readonly BuiltIn HitTriangleVertexPositionsKHR = + new BuiltIn(5335, "HitTriangleVertexPositionsKHR"); + + public static readonly BuiltIn IncomingRayFlagsNV = + new BuiltIn(5351, "IncomingRayFlagsNV"); + + public static readonly BuiltIn IncomingRayFlagsKHR = + new BuiltIn(5351, "IncomingRayFlagsKHR"); + + public static readonly BuiltIn RayGeometryIndexKHR = + new BuiltIn(5352, "RayGeometryIndexKHR"); + + public static readonly BuiltIn WarpsPerSMNV = + new BuiltIn(5374, "WarpsPerSMNV"); + + public static readonly BuiltIn SMCountNV = + new BuiltIn(5375, "SMCountNV"); + + public static readonly BuiltIn WarpIDNV = + new BuiltIn(5376, "WarpIDNV"); + + public static readonly BuiltIn SMIDNV = + new BuiltIn(5377, "SMIDNV"); + + public static readonly BuiltIn CullMaskKHR = + new BuiltIn(6021, "CullMaskKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct Scope : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public Scope(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly Scope CrossDevice = + new Scope(0, "CrossDevice"); + + public static readonly Scope Device = + new Scope(1, "Device"); + + public static readonly Scope Workgroup = + new Scope(2, "Workgroup"); + + public static readonly Scope Subgroup = + new Scope(3, "Subgroup"); + + public static readonly Scope Invocation = + new Scope(4, "Invocation"); + + public static readonly Scope QueueFamily = + new Scope(5, "QueueFamily"); + + public static readonly Scope QueueFamilyKHR = + new Scope(5, "QueueFamilyKHR"); + + public static readonly Scope ShaderCallKHR = + new Scope(6, "ShaderCallKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct GroupOperation : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public GroupOperation(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly GroupOperation Reduce = + new GroupOperation(0, "Reduce"); + + public static readonly GroupOperation InclusiveScan = + new GroupOperation(1, "InclusiveScan"); + + public static readonly GroupOperation ExclusiveScan = + new GroupOperation(2, "ExclusiveScan"); + + public static readonly GroupOperation ClusteredReduce = + new GroupOperation(3, "ClusteredReduce"); + + public static readonly GroupOperation PartitionedReduceNV = + new GroupOperation(6, "PartitionedReduceNV"); + + public static readonly GroupOperation PartitionedInclusiveScanNV = + new GroupOperation(7, "PartitionedInclusiveScanNV"); + + public static readonly GroupOperation PartitionedExclusiveScanNV = + new GroupOperation(8, "PartitionedExclusiveScanNV"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct KernelEnqueueFlags : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public KernelEnqueueFlags(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly KernelEnqueueFlags NoWait = + new KernelEnqueueFlags(0, "NoWait"); + + public static readonly KernelEnqueueFlags WaitKernel = + new KernelEnqueueFlags(1, "WaitKernel"); + + public static readonly KernelEnqueueFlags WaitWorkGroup = + new KernelEnqueueFlags(2, "WaitWorkGroup"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct Capability : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public Capability(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly Capability Matrix = + new Capability(0, "Matrix"); + + public static readonly Capability Shader = + new Capability(1, "Shader"); + + public static readonly Capability Geometry = + new Capability(2, "Geometry"); + + public static readonly Capability Tessellation = + new Capability(3, "Tessellation"); + + public static readonly Capability Addresses = + new Capability(4, "Addresses"); + + public static readonly Capability Linkage = + new Capability(5, "Linkage"); + + public static readonly Capability Kernel = + new Capability(6, "Kernel"); + + public static readonly Capability Vector16 = + new Capability(7, "Vector16"); + + public static readonly Capability Float16Buffer = + new Capability(8, "Float16Buffer"); + + public static readonly Capability Float16 = + new Capability(9, "Float16"); + + public static readonly Capability Float64 = + new Capability(10, "Float64"); + + public static readonly Capability Int64 = + new Capability(11, "Int64"); + + public static readonly Capability Int64Atomics = + new Capability(12, "Int64Atomics"); + + public static readonly Capability ImageBasic = + new Capability(13, "ImageBasic"); + + public static readonly Capability ImageReadWrite = + new Capability(14, "ImageReadWrite"); + + public static readonly Capability ImageMipmap = + new Capability(15, "ImageMipmap"); + + public static readonly Capability Pipes = + new Capability(17, "Pipes"); + + public static readonly Capability Groups = + new Capability(18, "Groups"); + + public static readonly Capability DeviceEnqueue = + new Capability(19, "DeviceEnqueue"); + + public static readonly Capability LiteralSampler = + new Capability(20, "LiteralSampler"); + + public static readonly Capability AtomicStorage = + new Capability(21, "AtomicStorage"); + + public static readonly Capability Int16 = + new Capability(22, "Int16"); + + public static readonly Capability TessellationPointSize = + new Capability(23, "TessellationPointSize"); + + public static readonly Capability GeometryPointSize = + new Capability(24, "GeometryPointSize"); + + public static readonly Capability ImageGatherExtended = + new Capability(25, "ImageGatherExtended"); + + public static readonly Capability StorageImageMultisample = + new Capability(27, "StorageImageMultisample"); + + public static readonly Capability UniformBufferArrayDynamicIndexing = + new Capability(28, "UniformBufferArrayDynamicIndexing"); + + public static readonly Capability SampledImageArrayDynamicIndexing = + new Capability(29, "SampledImageArrayDynamicIndexing"); + + public static readonly Capability StorageBufferArrayDynamicIndexing = + new Capability(30, "StorageBufferArrayDynamicIndexing"); + + public static readonly Capability StorageImageArrayDynamicIndexing = + new Capability(31, "StorageImageArrayDynamicIndexing"); + + public static readonly Capability ClipDistance = + new Capability(32, "ClipDistance"); + + public static readonly Capability CullDistance = + new Capability(33, "CullDistance"); + + public static readonly Capability ImageCubeArray = + new Capability(34, "ImageCubeArray"); + + public static readonly Capability SampleRateShading = + new Capability(35, "SampleRateShading"); + + public static readonly Capability ImageRect = + new Capability(36, "ImageRect"); + + public static readonly Capability SampledRect = + new Capability(37, "SampledRect"); + + public static readonly Capability GenericPointer = + new Capability(38, "GenericPointer"); + + public static readonly Capability Int8 = + new Capability(39, "Int8"); + + public static readonly Capability InputAttachment = + new Capability(40, "InputAttachment"); + + public static readonly Capability SparseResidency = + new Capability(41, "SparseResidency"); + + public static readonly Capability MinLod = + new Capability(42, "MinLod"); + + public static readonly Capability Sampled1D = + new Capability(43, "Sampled1D"); + + public static readonly Capability Image1D = + new Capability(44, "Image1D"); + + public static readonly Capability SampledCubeArray = + new Capability(45, "SampledCubeArray"); + + public static readonly Capability SampledBuffer = + new Capability(46, "SampledBuffer"); + + public static readonly Capability ImageBuffer = + new Capability(47, "ImageBuffer"); + + public static readonly Capability ImageMSArray = + new Capability(48, "ImageMSArray"); + + public static readonly Capability StorageImageExtendedFormats = + new Capability(49, "StorageImageExtendedFormats"); + + public static readonly Capability ImageQuery = + new Capability(50, "ImageQuery"); + + public static readonly Capability DerivativeControl = + new Capability(51, "DerivativeControl"); + + public static readonly Capability InterpolationFunction = + new Capability(52, "InterpolationFunction"); + + public static readonly Capability TransformFeedback = + new Capability(53, "TransformFeedback"); + + public static readonly Capability GeometryStreams = + new Capability(54, "GeometryStreams"); + + public static readonly Capability StorageImageReadWithoutFormat = + new Capability(55, "StorageImageReadWithoutFormat"); + + public static readonly Capability StorageImageWriteWithoutFormat = + new Capability(56, "StorageImageWriteWithoutFormat"); + + public static readonly Capability MultiViewport = + new Capability(57, "MultiViewport"); + + public static readonly Capability SubgroupDispatch = + new Capability(58, "SubgroupDispatch"); + + public static readonly Capability NamedBarrier = + new Capability(59, "NamedBarrier"); + + public static readonly Capability PipeStorage = + new Capability(60, "PipeStorage"); + + public static readonly Capability GroupNonUniform = + new Capability(61, "GroupNonUniform"); + + public static readonly Capability GroupNonUniformVote = + new Capability(62, "GroupNonUniformVote"); + + public static readonly Capability GroupNonUniformArithmetic = + new Capability(63, "GroupNonUniformArithmetic"); + + public static readonly Capability GroupNonUniformBallot = + new Capability(64, "GroupNonUniformBallot"); + + public static readonly Capability GroupNonUniformShuffle = + new Capability(65, "GroupNonUniformShuffle"); + + public static readonly Capability GroupNonUniformShuffleRelative = + new Capability(66, "GroupNonUniformShuffleRelative"); + + public static readonly Capability GroupNonUniformClustered = + new Capability(67, "GroupNonUniformClustered"); + + public static readonly Capability GroupNonUniformQuad = + new Capability(68, "GroupNonUniformQuad"); + + public static readonly Capability ShaderLayer = + new Capability(69, "ShaderLayer"); + + public static readonly Capability ShaderViewportIndex = + new Capability(70, "ShaderViewportIndex"); + + public static readonly Capability UniformDecoration = + new Capability(71, "UniformDecoration"); + + public static readonly Capability CoreBuiltinsARM = + new Capability(4165, "CoreBuiltinsARM"); + + public static readonly Capability TileImageColorReadAccessEXT = + new Capability(4166, "TileImageColorReadAccessEXT"); + + public static readonly Capability TileImageDepthReadAccessEXT = + new Capability(4167, "TileImageDepthReadAccessEXT"); + + public static readonly Capability TileImageStencilReadAccessEXT = + new Capability(4168, "TileImageStencilReadAccessEXT"); + + public static readonly Capability FragmentShadingRateKHR = + new Capability(4422, "FragmentShadingRateKHR"); + + public static readonly Capability SubgroupBallotKHR = + new Capability(4423, "SubgroupBallotKHR"); + + public static readonly Capability DrawParameters = + new Capability(4427, "DrawParameters"); + + public static readonly Capability WorkgroupMemoryExplicitLayoutKHR = + new Capability(4428, "WorkgroupMemoryExplicitLayoutKHR"); + + public static readonly Capability WorkgroupMemoryExplicitLayout8BitAccessKHR = + new Capability(4429, "WorkgroupMemoryExplicitLayout8BitAccessKHR"); + + public static readonly Capability WorkgroupMemoryExplicitLayout16BitAccessKHR = + new Capability(4430, "WorkgroupMemoryExplicitLayout16BitAccessKHR"); + + public static readonly Capability SubgroupVoteKHR = + new Capability(4431, "SubgroupVoteKHR"); + + public static readonly Capability StorageBuffer16BitAccess = + new Capability(4433, "StorageBuffer16BitAccess"); + + public static readonly Capability StorageUniformBufferBlock16 = + new Capability(4433, "StorageUniformBufferBlock16"); + + public static readonly Capability UniformAndStorageBuffer16BitAccess = + new Capability(4434, "UniformAndStorageBuffer16BitAccess"); + + public static readonly Capability StorageUniform16 = + new Capability(4434, "StorageUniform16"); + + public static readonly Capability StoragePushConstant16 = + new Capability(4435, "StoragePushConstant16"); + + public static readonly Capability StorageInputOutput16 = + new Capability(4436, "StorageInputOutput16"); + + public static readonly Capability DeviceGroup = + new Capability(4437, "DeviceGroup"); + + public static readonly Capability MultiView = + new Capability(4439, "MultiView"); + + public static readonly Capability VariablePointersStorageBuffer = + new Capability(4441, "VariablePointersStorageBuffer"); + + public static readonly Capability VariablePointers = + new Capability(4442, "VariablePointers"); + + public static readonly Capability AtomicStorageOps = + new Capability(4445, "AtomicStorageOps"); + + public static readonly Capability SampleMaskPostDepthCoverage = + new Capability(4447, "SampleMaskPostDepthCoverage"); + + public static readonly Capability StorageBuffer8BitAccess = + new Capability(4448, "StorageBuffer8BitAccess"); + + public static readonly Capability UniformAndStorageBuffer8BitAccess = + new Capability(4449, "UniformAndStorageBuffer8BitAccess"); + + public static readonly Capability StoragePushConstant8 = + new Capability(4450, "StoragePushConstant8"); + + public static readonly Capability DenormPreserve = + new Capability(4464, "DenormPreserve"); + + public static readonly Capability DenormFlushToZero = + new Capability(4465, "DenormFlushToZero"); + + public static readonly Capability SignedZeroInfNanPreserve = + new Capability(4466, "SignedZeroInfNanPreserve"); + + public static readonly Capability RoundingModeRTE = + new Capability(4467, "RoundingModeRTE"); + + public static readonly Capability RoundingModeRTZ = + new Capability(4468, "RoundingModeRTZ"); + + public static readonly Capability RayQueryProvisionalKHR = + new Capability(4471, "RayQueryProvisionalKHR"); + + public static readonly Capability RayQueryKHR = + new Capability(4472, "RayQueryKHR"); + + public static readonly Capability RayTraversalPrimitiveCullingKHR = + new Capability(4478, "RayTraversalPrimitiveCullingKHR"); + + public static readonly Capability RayTracingKHR = + new Capability(4479, "RayTracingKHR"); + + public static readonly Capability TextureSampleWeightedQCOM = + new Capability(4484, "TextureSampleWeightedQCOM"); + + public static readonly Capability TextureBoxFilterQCOM = + new Capability(4485, "TextureBoxFilterQCOM"); + + public static readonly Capability TextureBlockMatchQCOM = + new Capability(4486, "TextureBlockMatchQCOM"); + + public static readonly Capability Float16ImageAMD = + new Capability(5008, "Float16ImageAMD"); + + public static readonly Capability ImageGatherBiasLodAMD = + new Capability(5009, "ImageGatherBiasLodAMD"); + + public static readonly Capability FragmentMaskAMD = + new Capability(5010, "FragmentMaskAMD"); + + public static readonly Capability StencilExportEXT = + new Capability(5013, "StencilExportEXT"); + + public static readonly Capability ImageReadWriteLodAMD = + new Capability(5015, "ImageReadWriteLodAMD"); + + public static readonly Capability Int64ImageEXT = + new Capability(5016, "Int64ImageEXT"); + + public static readonly Capability ShaderClockKHR = + new Capability(5055, "ShaderClockKHR"); + + public static readonly Capability ShaderEnqueueAMDX = + new Capability(5067, "ShaderEnqueueAMDX"); + + public static readonly Capability SampleMaskOverrideCoverageNV = + new Capability(5249, "SampleMaskOverrideCoverageNV"); + + public static readonly Capability GeometryShaderPassthroughNV = + new Capability(5251, "GeometryShaderPassthroughNV"); + + public static readonly Capability ShaderViewportIndexLayerEXT = + new Capability(5254, "ShaderViewportIndexLayerEXT"); + + public static readonly Capability ShaderViewportIndexLayerNV = + new Capability(5254, "ShaderViewportIndexLayerNV"); + + public static readonly Capability ShaderViewportMaskNV = + new Capability(5255, "ShaderViewportMaskNV"); + + public static readonly Capability ShaderStereoViewNV = + new Capability(5259, "ShaderStereoViewNV"); + + public static readonly Capability PerViewAttributesNV = + new Capability(5260, "PerViewAttributesNV"); + + public static readonly Capability FragmentFullyCoveredEXT = + new Capability(5265, "FragmentFullyCoveredEXT"); + + public static readonly Capability MeshShadingNV = + new Capability(5266, "MeshShadingNV"); + + public static readonly Capability ImageFootprintNV = + new Capability(5282, "ImageFootprintNV"); + + public static readonly Capability MeshShadingEXT = + new Capability(5283, "MeshShadingEXT"); + + public static readonly Capability FragmentBarycentricKHR = + new Capability(5284, "FragmentBarycentricKHR"); + + public static readonly Capability FragmentBarycentricNV = + new Capability(5284, "FragmentBarycentricNV"); + + public static readonly Capability ComputeDerivativeGroupQuadsNV = + new Capability(5288, "ComputeDerivativeGroupQuadsNV"); + + public static readonly Capability FragmentDensityEXT = + new Capability(5291, "FragmentDensityEXT"); + + public static readonly Capability ShadingRateNV = + new Capability(5291, "ShadingRateNV"); + + public static readonly Capability GroupNonUniformPartitionedNV = + new Capability(5297, "GroupNonUniformPartitionedNV"); + + public static readonly Capability ShaderNonUniform = + new Capability(5301, "ShaderNonUniform"); + + public static readonly Capability ShaderNonUniformEXT = + new Capability(5301, "ShaderNonUniformEXT"); + + public static readonly Capability RuntimeDescriptorArray = + new Capability(5302, "RuntimeDescriptorArray"); + + public static readonly Capability RuntimeDescriptorArrayEXT = + new Capability(5302, "RuntimeDescriptorArrayEXT"); + + public static readonly Capability InputAttachmentArrayDynamicIndexing = + new Capability(5303, "InputAttachmentArrayDynamicIndexing"); + + public static readonly Capability InputAttachmentArrayDynamicIndexingEXT = + new Capability(5303, "InputAttachmentArrayDynamicIndexingEXT"); + + public static readonly Capability UniformTexelBufferArrayDynamicIndexing = + new Capability(5304, "UniformTexelBufferArrayDynamicIndexing"); + + public static readonly Capability UniformTexelBufferArrayDynamicIndexingEXT = + new Capability(5304, "UniformTexelBufferArrayDynamicIndexingEXT"); + + public static readonly Capability StorageTexelBufferArrayDynamicIndexing = + new Capability(5305, "StorageTexelBufferArrayDynamicIndexing"); + + public static readonly Capability StorageTexelBufferArrayDynamicIndexingEXT = + new Capability(5305, "StorageTexelBufferArrayDynamicIndexingEXT"); + + public static readonly Capability UniformBufferArrayNonUniformIndexing = + new Capability(5306, "UniformBufferArrayNonUniformIndexing"); + + public static readonly Capability UniformBufferArrayNonUniformIndexingEXT = + new Capability(5306, "UniformBufferArrayNonUniformIndexingEXT"); + + public static readonly Capability SampledImageArrayNonUniformIndexing = + new Capability(5307, "SampledImageArrayNonUniformIndexing"); + + public static readonly Capability SampledImageArrayNonUniformIndexingEXT = + new Capability(5307, "SampledImageArrayNonUniformIndexingEXT"); + + public static readonly Capability StorageBufferArrayNonUniformIndexing = + new Capability(5308, "StorageBufferArrayNonUniformIndexing"); + + public static readonly Capability StorageBufferArrayNonUniformIndexingEXT = + new Capability(5308, "StorageBufferArrayNonUniformIndexingEXT"); + + public static readonly Capability StorageImageArrayNonUniformIndexing = + new Capability(5309, "StorageImageArrayNonUniformIndexing"); + + public static readonly Capability StorageImageArrayNonUniformIndexingEXT = + new Capability(5309, "StorageImageArrayNonUniformIndexingEXT"); + + public static readonly Capability InputAttachmentArrayNonUniformIndexing = + new Capability(5310, "InputAttachmentArrayNonUniformIndexing"); + + public static readonly Capability InputAttachmentArrayNonUniformIndexingEXT = + new Capability(5310, "InputAttachmentArrayNonUniformIndexingEXT"); + + public static readonly Capability UniformTexelBufferArrayNonUniformIndexing = + new Capability(5311, "UniformTexelBufferArrayNonUniformIndexing"); + + public static readonly Capability UniformTexelBufferArrayNonUniformIndexingEXT = + new Capability(5311, "UniformTexelBufferArrayNonUniformIndexingEXT"); + + public static readonly Capability StorageTexelBufferArrayNonUniformIndexing = + new Capability(5312, "StorageTexelBufferArrayNonUniformIndexing"); + + public static readonly Capability StorageTexelBufferArrayNonUniformIndexingEXT = + new Capability(5312, "StorageTexelBufferArrayNonUniformIndexingEXT"); + + public static readonly Capability RayTracingPositionFetchKHR = + new Capability(5336, "RayTracingPositionFetchKHR"); + + public static readonly Capability RayTracingNV = + new Capability(5340, "RayTracingNV"); + + public static readonly Capability RayTracingMotionBlurNV = + new Capability(5341, "RayTracingMotionBlurNV"); + + public static readonly Capability VulkanMemoryModel = + new Capability(5345, "VulkanMemoryModel"); + + public static readonly Capability VulkanMemoryModelKHR = + new Capability(5345, "VulkanMemoryModelKHR"); + + public static readonly Capability VulkanMemoryModelDeviceScope = + new Capability(5346, "VulkanMemoryModelDeviceScope"); + + public static readonly Capability VulkanMemoryModelDeviceScopeKHR = + new Capability(5346, "VulkanMemoryModelDeviceScopeKHR"); + + public static readonly Capability PhysicalStorageBufferAddresses = + new Capability(5347, "PhysicalStorageBufferAddresses"); + + public static readonly Capability PhysicalStorageBufferAddressesEXT = + new Capability(5347, "PhysicalStorageBufferAddressesEXT"); + + public static readonly Capability ComputeDerivativeGroupLinearNV = + new Capability(5350, "ComputeDerivativeGroupLinearNV"); + + public static readonly Capability RayTracingProvisionalKHR = + new Capability(5353, "RayTracingProvisionalKHR"); + + public static readonly Capability CooperativeMatrixNV = + new Capability(5357, "CooperativeMatrixNV"); + + public static readonly Capability FragmentShaderSampleInterlockEXT = + new Capability(5363, "FragmentShaderSampleInterlockEXT"); + + public static readonly Capability FragmentShaderShadingRateInterlockEXT = + new Capability(5372, "FragmentShaderShadingRateInterlockEXT"); + + public static readonly Capability ShaderSMBuiltinsNV = + new Capability(5373, "ShaderSMBuiltinsNV"); + + public static readonly Capability FragmentShaderPixelInterlockEXT = + new Capability(5378, "FragmentShaderPixelInterlockEXT"); + + public static readonly Capability DemoteToHelperInvocation = + new Capability(5379, "DemoteToHelperInvocation"); + + public static readonly Capability DemoteToHelperInvocationEXT = + new Capability(5379, "DemoteToHelperInvocationEXT"); + + public static readonly Capability RayTracingOpacityMicromapEXT = + new Capability(5381, "RayTracingOpacityMicromapEXT"); + + public static readonly Capability ShaderInvocationReorderNV = + new Capability(5383, "ShaderInvocationReorderNV"); + + public static readonly Capability BindlessTextureNV = + new Capability(5390, "BindlessTextureNV"); + + public static readonly Capability RayQueryPositionFetchKHR = + new Capability(5391, "RayQueryPositionFetchKHR"); + + public static readonly Capability SubgroupShuffleINTEL = + new Capability(5568, "SubgroupShuffleINTEL"); + + public static readonly Capability SubgroupBufferBlockIOINTEL = + new Capability(5569, "SubgroupBufferBlockIOINTEL"); + + public static readonly Capability SubgroupImageBlockIOINTEL = + new Capability(5570, "SubgroupImageBlockIOINTEL"); + + public static readonly Capability SubgroupImageMediaBlockIOINTEL = + new Capability(5579, "SubgroupImageMediaBlockIOINTEL"); + + public static readonly Capability RoundToInfinityINTEL = + new Capability(5582, "RoundToInfinityINTEL"); + + public static readonly Capability FloatingPointModeINTEL = + new Capability(5583, "FloatingPointModeINTEL"); + + public static readonly Capability IntegerFunctions2INTEL = + new Capability(5584, "IntegerFunctions2INTEL"); + + public static readonly Capability FunctionPointersINTEL = + new Capability(5603, "FunctionPointersINTEL"); + + public static readonly Capability IndirectReferencesINTEL = + new Capability(5604, "IndirectReferencesINTEL"); + + public static readonly Capability AsmINTEL = + new Capability(5606, "AsmINTEL"); + + public static readonly Capability AtomicFloat32MinMaxEXT = + new Capability(5612, "AtomicFloat32MinMaxEXT"); + + public static readonly Capability AtomicFloat64MinMaxEXT = + new Capability(5613, "AtomicFloat64MinMaxEXT"); + + public static readonly Capability AtomicFloat16MinMaxEXT = + new Capability(5616, "AtomicFloat16MinMaxEXT"); + + public static readonly Capability VectorComputeINTEL = + new Capability(5617, "VectorComputeINTEL"); + + public static readonly Capability VectorAnyINTEL = + new Capability(5619, "VectorAnyINTEL"); + + public static readonly Capability ExpectAssumeKHR = + new Capability(5629, "ExpectAssumeKHR"); + + public static readonly Capability SubgroupAvcMotionEstimationINTEL = + new Capability(5696, "SubgroupAvcMotionEstimationINTEL"); + + public static readonly Capability SubgroupAvcMotionEstimationIntraINTEL = + new Capability(5697, "SubgroupAvcMotionEstimationIntraINTEL"); + + public static readonly Capability SubgroupAvcMotionEstimationChromaINTEL = + new Capability(5698, "SubgroupAvcMotionEstimationChromaINTEL"); + + public static readonly Capability VariableLengthArrayINTEL = + new Capability(5817, "VariableLengthArrayINTEL"); + + public static readonly Capability FunctionFloatControlINTEL = + new Capability(5821, "FunctionFloatControlINTEL"); + + public static readonly Capability FPGAMemoryAttributesINTEL = + new Capability(5824, "FPGAMemoryAttributesINTEL"); + + public static readonly Capability FPFastMathModeINTEL = + new Capability(5837, "FPFastMathModeINTEL"); + + public static readonly Capability ArbitraryPrecisionIntegersINTEL = + new Capability(5844, "ArbitraryPrecisionIntegersINTEL"); + + public static readonly Capability ArbitraryPrecisionFloatingPointINTEL = + new Capability(5845, "ArbitraryPrecisionFloatingPointINTEL"); + + public static readonly Capability UnstructuredLoopControlsINTEL = + new Capability(5886, "UnstructuredLoopControlsINTEL"); + + public static readonly Capability FPGALoopControlsINTEL = + new Capability(5888, "FPGALoopControlsINTEL"); + + public static readonly Capability KernelAttributesINTEL = + new Capability(5892, "KernelAttributesINTEL"); + + public static readonly Capability FPGAKernelAttributesINTEL = + new Capability(5897, "FPGAKernelAttributesINTEL"); + + public static readonly Capability FPGAMemoryAccessesINTEL = + new Capability(5898, "FPGAMemoryAccessesINTEL"); + + public static readonly Capability FPGAClusterAttributesINTEL = + new Capability(5904, "FPGAClusterAttributesINTEL"); + + public static readonly Capability LoopFuseINTEL = + new Capability(5906, "LoopFuseINTEL"); + + public static readonly Capability FPGADSPControlINTEL = + new Capability(5908, "FPGADSPControlINTEL"); + + public static readonly Capability MemoryAccessAliasingINTEL = + new Capability(5910, "MemoryAccessAliasingINTEL"); + + public static readonly Capability FPGAInvocationPipeliningAttributesINTEL = + new Capability(5916, "FPGAInvocationPipeliningAttributesINTEL"); + + public static readonly Capability FPGABufferLocationINTEL = + new Capability(5920, "FPGABufferLocationINTEL"); + + public static readonly Capability ArbitraryPrecisionFixedPointINTEL = + new Capability(5922, "ArbitraryPrecisionFixedPointINTEL"); + + public static readonly Capability USMStorageClassesINTEL = + new Capability(5935, "USMStorageClassesINTEL"); + + public static readonly Capability RuntimeAlignedAttributeINTEL = + new Capability(5939, "RuntimeAlignedAttributeINTEL"); + + public static readonly Capability IOPipesINTEL = + new Capability(5943, "IOPipesINTEL"); + + public static readonly Capability BlockingPipesINTEL = + new Capability(5945, "BlockingPipesINTEL"); + + public static readonly Capability FPGARegINTEL = + new Capability(5948, "FPGARegINTEL"); + + public static readonly Capability DotProductInputAll = + new Capability(6016, "DotProductInputAll"); + + public static readonly Capability DotProductInputAllKHR = + new Capability(6016, "DotProductInputAllKHR"); + + public static readonly Capability DotProductInput4x8Bit = + new Capability(6017, "DotProductInput4x8Bit"); + + public static readonly Capability DotProductInput4x8BitKHR = + new Capability(6017, "DotProductInput4x8BitKHR"); + + public static readonly Capability DotProductInput4x8BitPacked = + new Capability(6018, "DotProductInput4x8BitPacked"); + + public static readonly Capability DotProductInput4x8BitPackedKHR = + new Capability(6018, "DotProductInput4x8BitPackedKHR"); + + public static readonly Capability DotProduct = + new Capability(6019, "DotProduct"); + + public static readonly Capability DotProductKHR = + new Capability(6019, "DotProductKHR"); + + public static readonly Capability RayCullMaskKHR = + new Capability(6020, "RayCullMaskKHR"); + + public static readonly Capability CooperativeMatrixKHR = + new Capability(6022, "CooperativeMatrixKHR"); + + public static readonly Capability BitInstructions = + new Capability(6025, "BitInstructions"); + + public static readonly Capability GroupNonUniformRotateKHR = + new Capability(6026, "GroupNonUniformRotateKHR"); + + public static readonly Capability AtomicFloat32AddEXT = + new Capability(6033, "AtomicFloat32AddEXT"); + + public static readonly Capability AtomicFloat64AddEXT = + new Capability(6034, "AtomicFloat64AddEXT"); + + public static readonly Capability LongConstantCompositeINTEL = + new Capability(6089, "LongConstantCompositeINTEL"); + + public static readonly Capability OptNoneINTEL = + new Capability(6094, "OptNoneINTEL"); + + public static readonly Capability AtomicFloat16AddEXT = + new Capability(6095, "AtomicFloat16AddEXT"); + + public static readonly Capability DebugInfoModuleINTEL = + new Capability(6114, "DebugInfoModuleINTEL"); + + public static readonly Capability BFloat16ConversionINTEL = + new Capability(6115, "BFloat16ConversionINTEL"); + + public static readonly Capability SplitBarrierINTEL = + new Capability(6141, "SplitBarrierINTEL"); + + public static readonly Capability GlobalVariableFPGADecorationsINTEL = + new Capability(6146, "GlobalVariableFPGADecorationsINTEL"); + + public static readonly Capability FPGAKernelAttributesv2INTEL = + new Capability(6161, "FPGAKernelAttributesv2INTEL"); + + public static readonly Capability GlobalVariableHostAccessINTEL = + new Capability(6167, "GlobalVariableHostAccessINTEL"); + + public static readonly Capability FPMaxErrorINTEL = + new Capability(6169, "FPMaxErrorINTEL"); + + public static readonly Capability FPGALatencyControlINTEL = + new Capability(6171, "FPGALatencyControlINTEL"); + + public static readonly Capability FPGAArgumentInterfacesINTEL = + new Capability(6174, "FPGAArgumentInterfacesINTEL"); + + public static readonly Capability GroupUniformArithmeticKHR = + new Capability(6400, "GroupUniformArithmeticKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct RayQueryIntersection : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public RayQueryIntersection(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly RayQueryIntersection RayQueryCandidateIntersectionKHR = + new RayQueryIntersection(0, "RayQueryCandidateIntersectionKHR"); + + public static readonly RayQueryIntersection RayQueryCommittedIntersectionKHR = + new RayQueryIntersection(1, "RayQueryCommittedIntersectionKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct RayQueryCommittedIntersectionType : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public RayQueryCommittedIntersectionType(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly RayQueryCommittedIntersectionType RayQueryCommittedIntersectionNoneKHR = + new RayQueryCommittedIntersectionType(0, "RayQueryCommittedIntersectionNoneKHR"); + + public static readonly RayQueryCommittedIntersectionType RayQueryCommittedIntersectionTriangleKHR = + new RayQueryCommittedIntersectionType(1, "RayQueryCommittedIntersectionTriangleKHR"); + + public static readonly RayQueryCommittedIntersectionType RayQueryCommittedIntersectionGeneratedKHR = + new RayQueryCommittedIntersectionType(2, "RayQueryCommittedIntersectionGeneratedKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct RayQueryCandidateIntersectionType : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public RayQueryCandidateIntersectionType(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly RayQueryCandidateIntersectionType RayQueryCandidateIntersectionTriangleKHR = + new RayQueryCandidateIntersectionType(0, "RayQueryCandidateIntersectionTriangleKHR"); + + public static readonly RayQueryCandidateIntersectionType RayQueryCandidateIntersectionAABBKHR = + new RayQueryCandidateIntersectionType(1, "RayQueryCandidateIntersectionAABBKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct PackedVectorFormat : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public PackedVectorFormat(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly PackedVectorFormat PackedVectorFormat4x8Bit = + new PackedVectorFormat(0, "PackedVectorFormat4x8Bit"); + + public static readonly PackedVectorFormat PackedVectorFormat4x8BitKHR = + new PackedVectorFormat(0, "PackedVectorFormat4x8BitKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct CooperativeMatrixOperands : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public CooperativeMatrixOperands(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly CooperativeMatrixOperands NoneKHR = + new CooperativeMatrixOperands(0, "NoneKHR"); + + public static readonly CooperativeMatrixOperands MatrixASignedComponentsKHR = + new CooperativeMatrixOperands(1, "MatrixASignedComponentsKHR"); + + public static readonly CooperativeMatrixOperands MatrixBSignedComponentsKHR = + new CooperativeMatrixOperands(2, "MatrixBSignedComponentsKHR"); + + public static readonly CooperativeMatrixOperands MatrixCSignedComponentsKHR = + new CooperativeMatrixOperands(4, "MatrixCSignedComponentsKHR"); + + public static readonly CooperativeMatrixOperands MatrixResultSignedComponentsKHR = + new CooperativeMatrixOperands(8, "MatrixResultSignedComponentsKHR"); + + public static readonly CooperativeMatrixOperands SaturatingAccumulationKHR = + new CooperativeMatrixOperands(16, "SaturatingAccumulationKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct CooperativeMatrixLayout : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public CooperativeMatrixLayout(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly CooperativeMatrixLayout RowMajorKHR = + new CooperativeMatrixLayout(0, "RowMajorKHR"); + + public static readonly CooperativeMatrixLayout ColumnMajorKHR = + new CooperativeMatrixLayout(1, "ColumnMajorKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct CooperativeMatrixUse : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public CooperativeMatrixUse(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly CooperativeMatrixUse MatrixAKHR = + new CooperativeMatrixUse(0, "MatrixAKHR"); + + public static readonly CooperativeMatrixUse MatrixBKHR = + new CooperativeMatrixUse(1, "MatrixBKHR"); + + public static readonly CooperativeMatrixUse MatrixAccumulatorKHR = + new CooperativeMatrixUse(2, "MatrixAccumulatorKHR"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct InitializationModeQualifier : ISPIRVType + { + private SPIRVWord _value; + private string _repr; + + public InitializationModeQualifier(SPIRVWord word, string name) + { + _value = word; + _repr = name; + } + + public static readonly InitializationModeQualifier InitOnDeviceReprogramINTEL = + new InitializationModeQualifier(0, "InitOnDeviceReprogramINTEL"); + + public static readonly InitializationModeQualifier InitOnDeviceResetINTEL = + new InitializationModeQualifier(1, "InitOnDeviceResetINTEL"); + + public SPIRVWord[] ToWords() => + new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) }; + + public string ToRepr() => _repr; + } + + internal struct IdResultType : ISPIRVType + { + private SPIRVWord _value; + + public IdResultType(SPIRVWord word) + { + _value = word; + } + + public SPIRVWord[] ToWords() => new SPIRVWord[] { _value }; + + public string ToRepr() => "%" + _value; + + } + internal struct IdResult : ISPIRVType + { + private SPIRVWord _value; + + public IdResult(SPIRVWord word) + { + _value = word; + } + + public SPIRVWord[] ToWords() => new SPIRVWord[] { _value }; + + public string ToRepr() => "%" + _value; + + } + internal struct IdMemorySemantics : ISPIRVType + { + private SPIRVWord _value; + + public IdMemorySemantics(SPIRVWord word) + { + _value = word; + } + + public SPIRVWord[] ToWords() => new SPIRVWord[] { _value }; + + public string ToRepr() => "%" + _value; + + } + internal struct IdScope : ISPIRVType + { + private SPIRVWord _value; + + public IdScope(SPIRVWord word) + { + _value = word; + } + + public SPIRVWord[] ToWords() => new SPIRVWord[] { _value }; + + public string ToRepr() => "%" + _value; + + } + internal struct IdRef : ISPIRVType + { + private SPIRVWord _value; + + public IdRef(SPIRVWord word) + { + _value = word; + } + + public SPIRVWord[] ToWords() => new SPIRVWord[] { _value }; + + public string ToRepr() => "%" + _value; + + } + internal struct PairLiteralIntegerIdRef : ISPIRVType + { + public LiteralInteger base0; + public IdRef base1; + + public SPIRVWord[] ToWords() + { + List words = new List(); + words.AddRange(base0.ToWords()); + words.AddRange(base1.ToWords()); + return words.ToArray(); + } + + public string ToRepr() + { + string _repr = "{ "; + _repr += $"base0 = {base0.ToRepr()} "; + _repr += $"base1 = {base1.ToRepr()} "; + _repr += "}"; + return _repr; + } + } + + internal struct PairIdRefLiteralInteger : ISPIRVType + { + public IdRef base0; + public LiteralInteger base1; + + public SPIRVWord[] ToWords() + { + List words = new List(); + words.AddRange(base0.ToWords()); + words.AddRange(base1.ToWords()); + return words.ToArray(); + } + + public string ToRepr() + { + string _repr = "{ "; + _repr += $"base0 = {base0.ToRepr()} "; + _repr += $"base1 = {base1.ToRepr()} "; + _repr += "}"; + return _repr; + } + } + + internal struct PairIdRefIdRef : ISPIRVType + { + public IdRef base0; + public IdRef base1; + + public SPIRVWord[] ToWords() + { + List words = new List(); + words.AddRange(base0.ToWords()); + words.AddRange(base1.ToWords()); + return words.ToArray(); + } + + public string ToRepr() + { + string _repr = "{ "; + _repr += $"base0 = {base0.ToRepr()} "; + _repr += $"base1 = {base1.ToRepr()} "; + _repr += "}"; + return _repr; + } + } + +} diff --git a/Src/global.json b/Src/global.json new file mode 100644 index 000000000..cbde9308a --- /dev/null +++ b/Src/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "5.0.0", + "rollForward": "latestMajor", + "allowPrerelease": true + } +} \ No newline at end of file diff --git a/Tools/SPIRVGenerationTool/Generators/Builder/BinaryBuilderGenerator.cs b/Tools/SPIRVGenerationTool/Generators/Builder/BinaryBuilderGenerator.cs new file mode 100644 index 000000000..eaa1ef47d --- /dev/null +++ b/Tools/SPIRVGenerationTool/Generators/Builder/BinaryBuilderGenerator.cs @@ -0,0 +1,133 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: BinaryBuilderGenerator.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using SPIRVGenerationTool.Grammar; + +namespace SPIRVGenerationTool.Generators.Builder; + +public class BinaryBuilderGenerator : BuilderGenerator +{ + private const string Start = @"using System; +using System.Linq; +using System.Collections.Generic; +using ILGPU.Backends.SPIRV.Types; + +// disable: max_line_length + +#nullable enable + +namespace ILGPU.Backends.SPIRV { + + internal class BinarySPIRVBuilder : ISPIRVBuilder + { + + private readonly List _instructions = new List(); + + public byte[] ToByteArray() => _instructions + .Select(x => x.Data) + .Select(x => BitConverter.GetBytes(x)) + .SelectMany(x => x) + .ToArray(); + + public void AddMetadata( + SPIRVWord magic, + SPIRVWord version, + SPIRVWord genMagic, + SPIRVWord bound, + SPIRVWord schema) + { + _instructions.Add(magic); + _instructions.Add(version); + _instructions.Add(genMagic); + _instructions.Add(bound); + _instructions.Add(schema); + } + + public void Merge(ISPIRVBuilder other) + { + if(other == null) + throw new ArgumentNullException(nameof(other)); + + if(other is BinarySPIRVBuilder otherBinary) + { + _instructions.AddRange(otherBinary._instructions); + return; + } + + throw new InvalidCodeGenerationException( + ""Attempted to merge string representation builder with binary builder"" + ); + } + +"; + + public BinaryBuilderGenerator(string path) : base(Start, path) + { + } + + protected override void GenerateMethodBody(Operation info) + { + Builder.AppendLine(); + Builder.AppendIndentedLine("{"); + Builder.Indent(); + + if (info.Parameters.Count != 0) + { + Builder.AppendIndentedLine("var tempList = new List();"); + } + + foreach (var parameter in info.Parameters) + { + var name = parameter.Name; + + if (parameter.Quantifier == "?") + { + // There *is* a performance penalty for string interpolation + // because we're not calling actual StringBuilder methods which would + // compile to efficient code that just appends to the StringBuilder. + + // It shouldn't matter anyways, we're running this script like once a year. + Builder.AppendIndentedLine($"if({name} is {parameter.Type} {name}NotNull)") + .Indent() + .AppendIndentedLine($"tempList.AddRange({name}NotNull.ToWords());") + .Dedent(); + } + else if (parameter.Quantifier == "*") + { + Builder.AppendIndentedLine($"foreach(var el in {name})") + .AppendIndentedLine("{") + .Indent() + .AppendIndentedLine("tempList.AddRange(el.ToWords());") + .Dedent() + .AppendIndentedLine("}"); + } + else + { + Builder.AppendIndentedLine($"tempList.AddRange({name}.ToWords());"); + } + } + + Builder.AppendIndentedLine($"ushort opCode = {info.OpCode};"); + + if (info.Parameters.Count == 0) + Builder.AppendIndentedLine("ushort wordCount = 0;"); + else + Builder.AppendIndentedLine("ushort wordCount = (ushort) (tempList.Count + 1);"); + + Builder.AppendIndentedLine("uint combined = SPIRVBuilderUtils.JoinOpCodeWordCount(opCode, wordCount);") + .AppendIndentedLine("_instructions.Add(new SPIRVWord(combined));"); + + if (info.Parameters.Count != 0) + Builder.AppendIndentedLine("_instructions.AddRange(tempList);"); + + Builder.Dedent().AppendIndentedLine("}"); + } +} diff --git a/Tools/SPIRVGenerationTool/Generators/Builder/BuilderGenerator.cs b/Tools/SPIRVGenerationTool/Generators/Builder/BuilderGenerator.cs new file mode 100644 index 000000000..b4b82634e --- /dev/null +++ b/Tools/SPIRVGenerationTool/Generators/Builder/BuilderGenerator.cs @@ -0,0 +1,52 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: BuilderGenerator.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using SPIRVGenerationTool.Grammar; + +namespace SPIRVGenerationTool.Generators.Builder; + +public abstract class BuilderGenerator : GeneratorBase +{ + private const string End = @" } +} + +#nullable restore +"; + + protected BuilderGenerator(string start, string path) : base(start, End, path) + { + Builder.Indent().Indent(); + } + + protected override void GenerateCodeInternal(SPIRVGrammar grammar) + { + foreach (var instruction in grammar.Instructions) + { + var parameters = instruction.Operands?.Select(x => new Parameter(x)); + var parametersList = parameters?.ToList() ?? new List(); + var info = new Operation(instruction.OpName, instruction.OpCode, parametersList); + GenerateMethodHeader(info); + GenerateMethodBody(info); + Builder.AppendLine(); + } + } + + protected abstract void GenerateMethodBody(Operation info); + + private void GenerateMethodHeader(Operation info) + { + var fullParameters = info.Parameters.Select(x => x.FullParameter); + + Builder.AppendIndented($"public void Generate{info.Name}(") + .AppendJoin(", ", fullParameters) + .Append(")"); + } +} diff --git a/Tools/SPIRVGenerationTool/Generators/Builder/InterfaceBuilderGenerator.cs b/Tools/SPIRVGenerationTool/Generators/Builder/InterfaceBuilderGenerator.cs new file mode 100644 index 000000000..a4e74860a --- /dev/null +++ b/Tools/SPIRVGenerationTool/Generators/Builder/InterfaceBuilderGenerator.cs @@ -0,0 +1,55 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: InterfaceBuilderGenerator.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using SPIRVGenerationTool.Grammar; + +namespace SPIRVGenerationTool.Generators.Builder; + +public class InterfaceGenerator : BuilderGenerator +{ + private const string Start = @"using System; +using ILGPU.Backends.SPIRV.Types; + +// disable: max_line_length + +#nullable enable + +namespace ILGPU.Backends.SPIRV +{ + + internal interface ISPIRVBuilder + { + byte[] ToByteArray(); + + void AddMetadata( + SPIRVWord magic, + SPIRVWord version, + SPIRVWord genMagic, + SPIRVWord bound, + SPIRVWord schema); + + // This is the best way I could come up with to + // handle trying to merge different builders + // Implementing classes will kinda just have to + // deal with it + void Merge(ISPIRVBuilder other); +"; + + public InterfaceGenerator(string path) : base(Start, path) + { + } + + protected override void GenerateMethodBody(Operation info) + { + // No body, just finish method header + Builder.AppendLine(";"); + } +} diff --git a/Tools/SPIRVGenerationTool/Generators/Builder/StringBuilderGenerator.cs b/Tools/SPIRVGenerationTool/Generators/Builder/StringBuilderGenerator.cs new file mode 100644 index 000000000..f49334ea3 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Generators/Builder/StringBuilderGenerator.cs @@ -0,0 +1,75 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: StringBuilderGenerator.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using SPIRVGenerationTool.Grammar; + +namespace SPIRVGenerationTool.Generators.Builder; + +public class StringBuilderGenerator : BuilderGenerator +{ + private const string Start = @"using System; +using System.Text; +using ILGPU.Backends.SPIRV.Types; + +// disable: max_line_length + +#nullable enable + +namespace ILGPU.Backends.SPIRV +{ + +<# + PushIndent(standardIndent); +#> +internal class StringSPIRVBuilder : ISPIRVBuilder { + + private StringBuilder _builder = new StringBuilder(); + + public byte[] ToByteArray() => Encoding.UTF8.GetBytes(_builder.ToString()); + + public void AddMetadata( + SPIRVWord magic, + SPIRVWord version, + SPIRVWord genMagic, + SPIRVWord bound, + SPIRVWord schema) + { + _builder.AppendLine($""; Magic: {magic.Data:X}""); + _builder.AppendLine($""; Version: {version.Data:X}""); + _builder.AppendLine($""; Generator Magic: {genMagic.Data:X}""); + _builder.AppendLine($""; Bound: {bound}""); + _builder.AppendLine($""; Schema: {schema}""); + } + + public void Merge(ISPIRVBuilder other) { + if(other == null) { + throw new ArgumentNullException(nameof(other)); + } + + var otherString = other as StringSPIRVBuilder; + if(otherString == null) { + throw new InvalidCodeGenerationException( + ""Attempted to merge binary builder with string representation builder"" + ); + } + + _builder.Append(otherString._builder); + } +"; + + public StringBuilderGenerator(string path) : base(Start, path) + { + } + + protected override void GenerateMethodBody(Operation info) + { + } +} diff --git a/Tools/SPIRVGenerationTool/Generators/GeneratorBase.cs b/Tools/SPIRVGenerationTool/Generators/GeneratorBase.cs new file mode 100644 index 000000000..15df33a10 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Generators/GeneratorBase.cs @@ -0,0 +1,67 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: GeneratorBase.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using SPIRVGenerationTool.Grammar; +using SPIRVGenerationTool.Util; + +namespace SPIRVGenerationTool.Generators; + +public abstract class GeneratorBase +{ + private readonly string _end; + protected readonly IndentedStringBuilder Builder; + private readonly string _path; + + protected GeneratorBase(string start, string end, string path) + { + _end = end; + _path = path; + + string fileName = Path.GetFileName(path); + + string copyright = $""" +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: {fileName} +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- +""" ; + + Builder = new IndentedStringBuilder(); + Builder.AppendLine(copyright) + .AppendLine() + .Append(start); + } + + public void GenerateCode(SPIRVGrammar grammar) + { + GenerateCodeInternal(grammar); + Builder.Append(_end); + } + + protected abstract void GenerateCodeInternal(SPIRVGrammar grammar); + + public void WriteToFile() + { + string? dir = Path.GetDirectoryName(_path); + if (dir is not null) + { + Directory.CreateDirectory(dir); + } + + File.WriteAllText(_path, Builder.ToString()); + } +} diff --git a/Tools/SPIRVGenerationTool/Generators/Type/TypeGenerator.cs b/Tools/SPIRVGenerationTool/Generators/Type/TypeGenerator.cs new file mode 100644 index 000000000..7df7914e8 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Generators/Type/TypeGenerator.cs @@ -0,0 +1,188 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: TypeGenerator.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using SPIRVGenerationTool.Grammar; +using System.Text.Json; + +namespace SPIRVGenerationTool.Generators.Type; + +public class TypeGenerator : GeneratorBase +{ + private const string Start = @"using System; +using System.Collections.Generic; + +// disable: max_line_length + +namespace ILGPU.Backends.SPIRV.Types +{ +"; + + private const string End = "}\n"; + + public TypeGenerator(string path) : base(Start, End, path) + { + } + + protected override void GenerateCodeInternal(SPIRVGrammar grammar) + { + foreach (var type in grammar.Types) + { + GenerateType(type); + } + } + + void GenerateType(SPIRVType kind) + { + switch (kind.Category) + { + case "Id": + GenerateId(kind); + break; + case "ValueEnum": + case "BitEnum": + GenerateEnum(kind); + break; + case "Composite": + GenerateComposite(kind); + break; + } + } + + void GenerateId(SPIRVType kind) + { + Builder.Indent() + .AppendIndentedLine($"internal struct {kind.Name} : ISPIRVType") + .AppendIndentedLine("{") + .Indent() + .AppendIndentedLine("private SPIRVWord _value;") + .AppendLine() + .AppendIndentedLine($"public {kind.Name}(SPIRVWord word)") + .AppendIndentedLine("{") + .Indent() + .AppendIndentedLine("_value = word;") + .Dedent() + .AppendIndentedLine("}") + .AppendLine() + .AppendIndentedLine("public SPIRVWord[] ToWords() => new SPIRVWord[] { _value };") + .AppendLine() + .AppendIndentedLine("public string ToRepr() => \"%\" + _value;") + .AppendLine() + .Dedent() + .AppendIndentedLine("}") + .Dedent(); + } + + void GenerateEnum(SPIRVType kind) + { + Builder.Indent() + .AppendIndentedLine($"internal struct {kind.Name} : ISPIRVType") + .AppendIndentedLine("{") + .Indent() + .AppendIndentedLine("private SPIRVWord _value;") + .AppendIndentedLine("private string _repr;") + .AppendLine() + .AppendIndentedLine($"public {kind.Name}(SPIRVWord word, string name)") + .AppendIndentedLine("{") + .Indent() + .AppendIndentedLine("_value = word;") + .AppendIndentedLine("_repr = name;") + .Dedent() + .AppendIndentedLine("}") + .AppendLine(); + + // Enums always have enumerants + foreach (var enumerant in kind.Enumerants!) + { + // Parse hex _value if string + uint enumValue = enumerant.Value.ValueKind == JsonValueKind.String + ? Convert.ToUInt32(enumerant.Value.GetString(), 16) + : enumerant.Value.GetUInt32(); + + string enumName = enumerant.Name; + string kindName = kind.Name; + + Builder.AppendIndentedLine($"public static readonly {kindName} {enumName} =") + .Indent() + .AppendIndentedLine($"new {kindName}({enumValue}, \"{enumName}\");") + .Dedent() + .AppendLine(); + } + + Builder.AppendIndentedLine("public SPIRVWord[] ToWords() =>") + .Indent() + .AppendIndentedLine("new SPIRVWord[] { SPIRVWord.FromBytes(BitConverter.GetBytes(_value.Data)) };") + .Dedent() + .AppendLine() + .AppendIndentedLine("public string ToRepr() => _repr;") + .Dedent() + .AppendIndentedLine("}") + .Dedent() + .AppendLine(); + } + + void GenerateComposite(SPIRVType kind) + { + Builder.Indent() + .AppendIndentedLine($"internal struct {kind.Name} : ISPIRVType") + .AppendIndentedLine("{") + .Indent(); + + for (int i = 0; i < kind.Bases.Count; i++) + { + Builder.AppendIndentedLine($"public {kind.Bases[i]} base{i};"); + } + + Builder.AppendLine(); + + #region ToWords + + Builder.AppendIndentedLine("public SPIRVWord[] ToWords()") + .AppendIndentedLine("{") + .Indent() + .AppendIndentedLine("List words = new List();"); + + for (int i = 0; i < kind.Bases.Count; i++) + { + Builder.AppendIndentedLine($"words.AddRange(base{i}.ToWords());"); + } + + Builder.AppendIndentedLine("return words.ToArray();") + .Dedent() + .AppendIndentedLine("}") + .AppendLine(); + + #endregion + + #region ToRepr + + Builder.AppendIndentedLine("public string ToRepr()") + .AppendIndentedLine("{") + .Indent() + .AppendIndentedLine("string _repr = \"{ \";"); + + for (int i = 0; i < kind.Bases.Count; i++) + { + Builder.AppendIndentedLine($"_repr += $\"base{i} = {{base{i}.ToRepr()}} \";"); + } + + Builder.AppendIndentedLine("_repr += \"}\";") + .AppendIndentedLine("return _repr;") + .Dedent() + .AppendIndentedLine("}"); + + #endregion + + Builder.Dedent() + .AppendIndentedLine("}") + .Dedent() + .AppendLine(); + } +} diff --git a/Tools/SPIRVGenerationTool/Grammar/Grammar.cs b/Tools/SPIRVGenerationTool/Grammar/Grammar.cs new file mode 100644 index 000000000..989cef891 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Grammar/Grammar.cs @@ -0,0 +1,59 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: Grammar.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SPIRVGenerationTool.Grammar; + +public class SPIRVGrammar +{ + public required List Instructions { get; set; } + + [JsonPropertyName("operand_kinds")] + public required List Types { get; set; } +} + +public class SPIRVOp +{ + public required string OpName { get; set; } + + public required int OpCode { get; set; } + + public List? Operands { get; set; } +} + +public class SPIRVOperand +{ + public required string Kind { get; set; } + + public string? Name { get; set; } + + public string Quantifier { get; set; } = ""; +} + +public class SPIRVType +{ + public List Bases { get; set; } + + public required string Category { get; set; } + + public List? Enumerants { get; } + + [JsonPropertyName("kind")] public required string Name { get; set; } +} + +public class SPIRVEnumerant +{ + [JsonPropertyName("enumerant")] public required string Name { get; set; } + + public required JsonElement Value { get; set; } +} diff --git a/Tools/SPIRVGenerationTool/Grammar/Operation.cs b/Tools/SPIRVGenerationTool/Grammar/Operation.cs new file mode 100644 index 000000000..5425c37ab --- /dev/null +++ b/Tools/SPIRVGenerationTool/Grammar/Operation.cs @@ -0,0 +1,14 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: Operation.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +namespace SPIRVGenerationTool.Grammar; + +public record Operation(string Name, int OpCode, List Parameters); diff --git a/Tools/SPIRVGenerationTool/Grammar/Parameter.cs b/Tools/SPIRVGenerationTool/Grammar/Parameter.cs new file mode 100644 index 000000000..c8cdd1571 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Grammar/Parameter.cs @@ -0,0 +1,35 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: Parameter.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +namespace SPIRVGenerationTool.Grammar; + +public class Parameter +{ + public string Type { get; } + public string Quantifier { get; } + public string Name { get; } + public string FullParameter { get; } + + public Parameter(SPIRVOperand operand) + { + Type = operand.Kind; + Quantifier = operand.Quantifier; + + Name = operand.Name!; // Will be filled by preprocessor + + FullParameter = operand.Quantifier switch + { + "*" => $"params {Type}[] {Name}", + "?" => $"{Type}? {Name} = null", + _ => $"{Type} {Name}" + }; + } +} diff --git a/Tools/SPIRVGenerationTool/Grammar/Preprocessor.cs b/Tools/SPIRVGenerationTool/Grammar/Preprocessor.cs new file mode 100644 index 000000000..f4d2d1148 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Grammar/Preprocessor.cs @@ -0,0 +1,118 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: Preprocessor.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +namespace SPIRVGenerationTool.Grammar; + +public static class Preprocessor +{ + public static void Process(SPIRVGrammar grammar) + { + // Instructions + RemoveInvalidCharacters(grammar); + CamelCase(grammar); + SanitizeNames(grammar); + Rename(grammar); + + // Types + SanitizeEnumerantNames(grammar); + } + + private static void SanitizeEnumerantNames(SPIRVGrammar grammar) + { + foreach (var type in grammar.Types) + { + if(type.Enumerants is null) + continue; + + foreach (var enumerant in type.Enumerants) + { + if (char.IsDigit(enumerant.Name[0])) + enumerant.Name = "n" + enumerant.Name; + } + } + } + + private static void RemoveInvalidCharacters(SPIRVGrammar grammar) + { + foreach (var inst in grammar.Instructions) + { + if (inst.Operands is null) + continue; + + foreach (var operand in inst.Operands) + { + operand.Name = operand.Name?.Replace(" ", "").Replace("'", "").Replace(".", "").Replace(",", "") + .Replace("+", "").Replace(">", "").Replace("<", "").Replace("\n", "").Replace("~", ""); + } + } + } + + private static readonly HashSet KeywordSet = new() + { + "base", "ref", "interface", "string", "object", "default", "event" + }; + + private static void SanitizeNames(SPIRVGrammar grammar) + { + foreach (var inst in grammar.Instructions) + { + if (inst.Operands is null) + continue; + + foreach (var operand in inst.Operands) + { + if (string.IsNullOrEmpty(operand.Name)) + continue; + + if (KeywordSet.Contains(operand.Name)) + operand.Name = "@" + operand.Name; + + } + } + } + + private static void CamelCase(SPIRVGrammar grammar) + { + foreach (var inst in grammar.Instructions) + { + if (inst.Operands is null) + continue; + + foreach (var operand in inst.Operands) + { + if (!string.IsNullOrEmpty(operand.Name)) + { + operand.Name = char.ToLower(operand.Name[0]) + operand.Name[1..]; + } + } + } + } + + private static void Rename(SPIRVGrammar grammar) + { + foreach (var inst in grammar.Instructions) + { + if (inst.Operands is null) + continue; + + for (int i = 0; i < inst.Operands.Count; i++) + { + var operand = inst.Operands[i]; + operand.Name = operand.Kind switch + { + "IdResult" => "resultId", + "IdResultType" => "resultType", + _ => string.IsNullOrEmpty(operand.Name) ? $"param{i}" : operand.Name + }; + } + } + } +} diff --git a/Tools/SPIRVGenerationTool/Program.cs b/Tools/SPIRVGenerationTool/Program.cs new file mode 100644 index 000000000..c7b7bb3c4 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Program.cs @@ -0,0 +1,45 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: Program.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + + +using SPIRVGenerationTool.Generators; +using System.Text.Json; +using SPIRVGenerationTool.Generators.Builder; +using SPIRVGenerationTool.Generators.Type; +using SPIRVGenerationTool.Grammar; + +var pathToGrammar = args[0]; +var outputDirectory = args[1]; + +var file = File.ReadAllText(pathToGrammar); +var grammar = JsonSerializer.Deserialize(file, + new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true + }); + +if (grammar is null) + throw new Exception("Grammar could not be parsed"); + +Preprocessor.Process(grammar); + +var generators = new List +{ + new BinaryBuilderGenerator(Path.Combine(outputDirectory, "BinarySPIRVBuilder.cs")), + new InterfaceGenerator(Path.Combine(outputDirectory, "ISPIRVBuilder.cs")), + new TypeGenerator(Path.Combine(outputDirectory, "Types", "SPIRVTypes.cs")) +}; + +foreach (var generator in generators) +{ + generator.GenerateCode(grammar); + generator.WriteToFile(); +} diff --git a/Tools/SPIRVGenerationTool/SPIRV-Headers b/Tools/SPIRVGenerationTool/SPIRV-Headers new file mode 160000 index 000000000..d790ced75 --- /dev/null +++ b/Tools/SPIRVGenerationTool/SPIRV-Headers @@ -0,0 +1 @@ +Subproject commit d790ced752b5bfc06b6988baadef6eb2d16bdf96 diff --git a/Tools/SPIRVGenerationTool/SPIRVGenerationTool.csproj b/Tools/SPIRVGenerationTool/SPIRVGenerationTool.csproj new file mode 100644 index 000000000..b6e407674 --- /dev/null +++ b/Tools/SPIRVGenerationTool/SPIRVGenerationTool.csproj @@ -0,0 +1,14 @@ + + + + Exe + net7.0 + enable + enable + + + + $(DefaultItemExcludes);SPIRV-Headers\**\*.* + + + diff --git a/Tools/SPIRVGenerationTool/Util/IndentedStringBuilder.cs b/Tools/SPIRVGenerationTool/Util/IndentedStringBuilder.cs new file mode 100644 index 000000000..3df2f3d01 --- /dev/null +++ b/Tools/SPIRVGenerationTool/Util/IndentedStringBuilder.cs @@ -0,0 +1,73 @@ +// --------------------------------------------------------------------------------------- +// ILGPU +// Copyright (c) 2023 ILGPU Project +// www.ilgpu.net +// +// File: IndentedStringBuilder.cs +// +// This file is part of ILGPU and is distributed under the University of Illinois Open +// Source License. See LICENSE.txt for details. +// --------------------------------------------------------------------------------------- + +using System.Text; + +namespace SPIRVGenerationTool.Util; + +public class IndentedStringBuilder +{ + private StringBuilder _builder = new(); + private int _indentLevel = 0; + + public IndentedStringBuilder Append(string s) + { + _builder.Append(s); + return this; + } + + public IndentedStringBuilder AppendLine() + { + _builder.AppendLine(); + return this; + } + + public IndentedStringBuilder AppendLine(string s) + { + _builder.AppendLine(s); + return this; + } + + public IndentedStringBuilder AppendJoin(string sep, IEnumerable e) + { + _builder.AppendJoin(sep, e); + return this; + } + + public IndentedStringBuilder AppendIndented(string s) + { + for (int i = 0; i < _indentLevel; i++) + { + Append(" "); + } + + return Append(s); + } + + public IndentedStringBuilder AppendIndentedLine(string s) + { + return AppendIndented(s).AppendLine(); + } + + public IndentedStringBuilder Indent() + { + _indentLevel++; + return this; + } + + public IndentedStringBuilder Dedent() + { + _indentLevel--; + return this; + } + + public override string ToString() => _builder.ToString(); +} diff --git a/Tools/Tools.sln b/Tools/Tools.sln index 0adc38216..45578197c 100644 --- a/Tools/Tools.sln +++ b/Tools/Tools.sln @@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GenerateCompatibilitySuppre GenerateCompatibilitySuppressionFiles\GenerateCompatibilitySuppressionFiles.ps1 = GenerateCompatibilitySuppressionFiles\GenerateCompatibilitySuppressionFiles.ps1 EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPIRVGenerationTool", "SPIRVGenerationTool\SPIRVGenerationTool.csproj", "{80F7A795-40B3-40D3-975F-66E986F7C8A3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -31,6 +33,10 @@ Global {2F92ECC4-CE02-4B1A-8B59-DC866185DA69}.Debug|Any CPU.Build.0 = Debug|Any CPU {2F92ECC4-CE02-4B1A-8B59-DC866185DA69}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F92ECC4-CE02-4B1A-8B59-DC866185DA69}.Release|Any CPU.Build.0 = Release|Any CPU + {80F7A795-40B3-40D3-975F-66E986F7C8A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80F7A795-40B3-40D3-975F-66E986F7C8A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80F7A795-40B3-40D3-975F-66E986F7C8A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80F7A795-40B3-40D3-975F-66E986F7C8A3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/global.json b/global.json index b79dd8fc7..237f5ce13 100644 --- a/global.json +++ b/global.json @@ -4,4 +4,4 @@ "rollForward": "latestFeature", "allowPrerelease": false } -} \ No newline at end of file +}