Migrate to .NET 9 (#198)

This commit is contained in:
Marco Carvalho 2024-12-19 21:52:25 -03:00 committed by GitHub
parent 8db5a7e98b
commit ff6628149d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
136 changed files with 278 additions and 270 deletions

View file

@ -26,6 +26,7 @@
// IN THE MATERIALS.
#endregion
using System;
using static Spv.Specification;
namespace Spv.Generator
@ -192,7 +193,7 @@ namespace Spv.Generator
return result;
}
public Instruction Decorate(Instruction target, Decoration decoration, params IOperand[] parameters)
public Instruction Decorate(Instruction target, Decoration decoration, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpDecorate);
@ -229,7 +230,7 @@ namespace Spv.Generator
return result;
}
public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpMemberDecorate);
@ -251,7 +252,7 @@ namespace Spv.Generator
return result;
}
public Instruction GroupDecorate(Instruction decorationGroup, params Instruction[] targets)
public Instruction GroupDecorate(Instruction decorationGroup, params ReadOnlySpan<Instruction> targets)
{
Instruction result = NewInstruction(Op.OpGroupDecorate);
@ -262,7 +263,7 @@ namespace Spv.Generator
return result;
}
public Instruction GroupMemberDecorate(Instruction decorationGroup, params IOperand[] targets)
public Instruction GroupMemberDecorate(Instruction decorationGroup, params ReadOnlySpan<IOperand> targets)
{
Instruction result = NewInstruction(Op.OpGroupMemberDecorate);
@ -273,7 +274,7 @@ namespace Spv.Generator
return result;
}
public Instruction DecorateId(Instruction target, Decoration decoration, params IOperand[] parameters)
public Instruction DecorateId(Instruction target, Decoration decoration, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpDecorateId);
@ -285,7 +286,7 @@ namespace Spv.Generator
return result;
}
public Instruction DecorateString(Instruction target, Decoration decoration, params IOperand[] parameters)
public Instruction DecorateString(Instruction target, Decoration decoration, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpDecorateString);
@ -297,7 +298,7 @@ namespace Spv.Generator
return result;
}
public Instruction DecorateStringGOOGLE(Instruction target, Decoration decoration, params IOperand[] parameters)
public Instruction DecorateStringGOOGLE(Instruction target, Decoration decoration, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpDecorateStringGOOGLE);
@ -309,7 +310,7 @@ namespace Spv.Generator
return result;
}
public Instruction MemberDecorateString(Instruction structType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
public Instruction MemberDecorateString(Instruction structType, LiteralInteger member, Decoration decoration, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpMemberDecorateString);
@ -322,7 +323,7 @@ namespace Spv.Generator
return result;
}
public Instruction MemberDecorateStringGOOGLE(Instruction structType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
public Instruction MemberDecorateStringGOOGLE(Instruction structType, LiteralInteger member, Decoration decoration, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpMemberDecorateStringGOOGLE);
@ -458,7 +459,7 @@ namespace Spv.Generator
return result;
}
public Instruction TypeStruct(bool forceIdAllocation, params Instruction[] parameters)
public Instruction TypeStruct(bool forceIdAllocation, params ReadOnlySpan<Instruction> parameters)
{
Instruction result = NewInstruction(Op.OpTypeStruct);
@ -489,7 +490,7 @@ namespace Spv.Generator
return result;
}
public Instruction TypeFunction(Instruction returnType, bool forceIdAllocation, params Instruction[] parameters)
public Instruction TypeFunction(Instruction returnType, bool forceIdAllocation, params ReadOnlySpan<Instruction> parameters)
{
Instruction result = NewInstruction(Op.OpTypeFunction);
@ -605,7 +606,7 @@ namespace Spv.Generator
return result;
}
public Instruction ConstantComposite(Instruction resultType, params Instruction[] constituents)
public Instruction ConstantComposite(Instruction resultType, params ReadOnlySpan<Instruction> constituents)
{
Instruction result = NewInstruction(Op.OpConstantComposite, Instruction.InvalidId, resultType);
@ -664,7 +665,7 @@ namespace Spv.Generator
return result;
}
public Instruction SpecConstantComposite(Instruction resultType, params Instruction[] constituents)
public Instruction SpecConstantComposite(Instruction resultType, params ReadOnlySpan<Instruction> constituents)
{
Instruction result = NewInstruction(Op.OpSpecConstantComposite, GetNewId(), resultType);
@ -814,7 +815,7 @@ namespace Spv.Generator
return result;
}
public Instruction AccessChain(Instruction resultType, Instruction baseObj, params Instruction[] indexes)
public Instruction AccessChain(Instruction resultType, Instruction baseObj, params ReadOnlySpan<Instruction> indexes)
{
Instruction result = NewInstruction(Op.OpAccessChain, GetNewId(), resultType);
@ -825,7 +826,7 @@ namespace Spv.Generator
return result;
}
public Instruction InBoundsAccessChain(Instruction resultType, Instruction baseObj, params Instruction[] indexes)
public Instruction InBoundsAccessChain(Instruction resultType, Instruction baseObj, params ReadOnlySpan<Instruction> indexes)
{
Instruction result = NewInstruction(Op.OpInBoundsAccessChain, GetNewId(), resultType);
@ -836,7 +837,7 @@ namespace Spv.Generator
return result;
}
public Instruction PtrAccessChain(Instruction resultType, Instruction baseObj, Instruction element, params Instruction[] indexes)
public Instruction PtrAccessChain(Instruction resultType, Instruction baseObj, Instruction element, params ReadOnlySpan<Instruction> indexes)
{
Instruction result = NewInstruction(Op.OpPtrAccessChain, GetNewId(), resultType);
@ -869,7 +870,7 @@ namespace Spv.Generator
return result;
}
public Instruction InBoundsPtrAccessChain(Instruction resultType, Instruction baseObj, Instruction element, params Instruction[] indexes)
public Instruction InBoundsPtrAccessChain(Instruction resultType, Instruction baseObj, Instruction element, params ReadOnlySpan<Instruction> indexes)
{
Instruction result = NewInstruction(Op.OpInBoundsPtrAccessChain, GetNewId(), resultType);
@ -949,7 +950,7 @@ namespace Spv.Generator
return result;
}
public Instruction FunctionCall(Instruction resultType, Instruction function, params Instruction[] parameters)
public Instruction FunctionCall(Instruction resultType, Instruction function, params ReadOnlySpan<Instruction> parameters)
{
Instruction result = NewInstruction(Op.OpFunctionCall, GetNewId(), resultType);
@ -973,7 +974,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleImplicitLod, GetNewId(), resultType);
@ -992,7 +993,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleExplicitLod, GetNewId(), resultType);
@ -1008,7 +1009,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleDrefImplicitLod, GetNewId(), resultType);
@ -1028,7 +1029,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleDrefExplicitLod, GetNewId(), resultType);
@ -1045,7 +1046,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleProjImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleProjImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleProjImplicitLod, GetNewId(), resultType);
@ -1064,7 +1065,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleProjExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleProjExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleProjExplicitLod, GetNewId(), resultType);
@ -1080,7 +1081,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleProjDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleProjDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleProjDrefImplicitLod, GetNewId(), resultType);
@ -1100,7 +1101,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleProjDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleProjDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleProjDrefExplicitLod, GetNewId(), resultType);
@ -1117,7 +1118,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageFetch(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageFetch(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageFetch, GetNewId(), resultType);
@ -1136,7 +1137,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction component, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction component, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageGather, GetNewId(), resultType);
@ -1156,7 +1157,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageDrefGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageDrefGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageDrefGather, GetNewId(), resultType);
@ -1176,7 +1177,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageRead(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageRead(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageRead, GetNewId(), resultType);
@ -1195,7 +1196,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageWrite(Instruction image, Instruction coordinate, Instruction texel, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageWrite(Instruction image, Instruction coordinate, Instruction texel, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageWrite);
@ -1297,7 +1298,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleImplicitLod, GetNewId(), resultType);
@ -1316,7 +1317,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleExplicitLod, GetNewId(), resultType);
@ -1332,7 +1333,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleDrefImplicitLod, GetNewId(), resultType);
@ -1352,7 +1353,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleDrefExplicitLod, GetNewId(), resultType);
@ -1369,7 +1370,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleProjImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleProjImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleProjImplicitLod, GetNewId(), resultType);
@ -1388,7 +1389,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleProjExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleProjExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleProjExplicitLod, GetNewId(), resultType);
@ -1404,7 +1405,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleProjDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleProjDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleProjDrefImplicitLod, GetNewId(), resultType);
@ -1424,7 +1425,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseSampleProjDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseSampleProjDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseSampleProjDrefExplicitLod, GetNewId(), resultType);
@ -1441,7 +1442,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseFetch(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseFetch(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseFetch, GetNewId(), resultType);
@ -1460,7 +1461,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction component, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction component, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseGather, GetNewId(), resultType);
@ -1480,7 +1481,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseDrefGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseDrefGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseDrefGather, GetNewId(), resultType);
@ -1510,7 +1511,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSparseRead(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSparseRead(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSparseRead, GetNewId(), resultType);
@ -1529,7 +1530,7 @@ namespace Spv.Generator
return result;
}
public Instruction ImageSampleFootprintNV(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction granularity, Instruction coarse, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
public Instruction ImageSampleFootprintNV(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction granularity, Instruction coarse, ImageOperandsMask imageOperands, params ReadOnlySpan<Instruction> imageOperandIds)
{
Instruction result = NewInstruction(Op.OpImageSampleFootprintNV, GetNewId(), resultType);
@ -1738,7 +1739,7 @@ namespace Spv.Generator
return result;
}
public Instruction VectorShuffle(Instruction resultType, Instruction vector1, Instruction vector2, params LiteralInteger[] components)
public Instruction VectorShuffle(Instruction resultType, Instruction vector1, Instruction vector2, params ReadOnlySpan<LiteralInteger> components)
{
Instruction result = NewInstruction(Op.OpVectorShuffle, GetNewId(), resultType);
@ -1750,7 +1751,7 @@ namespace Spv.Generator
return result;
}
public Instruction CompositeConstruct(Instruction resultType, params Instruction[] constituents)
public Instruction CompositeConstruct(Instruction resultType, params ReadOnlySpan<Instruction> constituents)
{
Instruction result = NewInstruction(Op.OpCompositeConstruct, GetNewId(), resultType);
@ -1760,7 +1761,7 @@ namespace Spv.Generator
return result;
}
public Instruction CompositeExtract(Instruction resultType, Instruction composite, params LiteralInteger[] indexes)
public Instruction CompositeExtract(Instruction resultType, Instruction composite, params ReadOnlySpan<LiteralInteger> indexes)
{
Instruction result = NewInstruction(Op.OpCompositeExtract, GetNewId(), resultType);
@ -1771,7 +1772,7 @@ namespace Spv.Generator
return result;
}
public Instruction CompositeInsert(Instruction resultType, Instruction obj, Instruction composite, params LiteralInteger[] indexes)
public Instruction CompositeInsert(Instruction resultType, Instruction obj, Instruction composite, params ReadOnlySpan<LiteralInteger> indexes)
{
Instruction result = NewInstruction(Op.OpCompositeInsert, GetNewId(), resultType);
@ -2752,7 +2753,7 @@ namespace Spv.Generator
// Control-Flow
public Instruction Phi(Instruction resultType, params Instruction[] parameters)
public Instruction Phi(Instruction resultType, params ReadOnlySpan<Instruction> parameters)
{
Instruction result = NewInstruction(Op.OpPhi, GetNewId(), resultType);
@ -2802,7 +2803,7 @@ namespace Spv.Generator
return result;
}
public Instruction BranchConditional(Instruction condition, Instruction trueLabel, Instruction falseLabel, params LiteralInteger[] branchweights)
public Instruction BranchConditional(Instruction condition, Instruction trueLabel, Instruction falseLabel, params ReadOnlySpan<LiteralInteger> branchweights)
{
Instruction result = NewInstruction(Op.OpBranchConditional);
@ -2815,7 +2816,7 @@ namespace Spv.Generator
return result;
}
public Instruction Switch(Instruction selector, Instruction defaultObj, params IOperand[] target)
public Instruction Switch(Instruction selector, Instruction defaultObj, params ReadOnlySpan<IOperand> target)
{
Instruction result = NewInstruction(Op.OpSwitch);
@ -3678,7 +3679,7 @@ namespace Spv.Generator
return result;
}
public Instruction EnqueueKernel(Instruction resultType, Instruction queue, Instruction flags, Instruction nDRange, Instruction numEvents, Instruction waitEvents, Instruction retEvent, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign, params Instruction[] localSize)
public Instruction EnqueueKernel(Instruction resultType, Instruction queue, Instruction flags, Instruction nDRange, Instruction numEvents, Instruction waitEvents, Instruction retEvent, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign, params ReadOnlySpan<Instruction> localSize)
{
Instruction result = NewInstruction(Op.OpEnqueueKernel, GetNewId(), resultType);
@ -5108,7 +5109,7 @@ namespace Spv.Generator
return result;
}
public Instruction LoopControlINTEL(params LiteralInteger[] loopControlParameters)
public Instruction LoopControlINTEL(params ReadOnlySpan<LiteralInteger> loopControlParameters)
{
Instruction result = NewInstruction(Op.OpLoopControlINTEL);

View file

@ -64,7 +64,7 @@ namespace Spv.Generator
_operands.Add(value);
}
public void AddOperand(IOperand[] value)
public void AddOperand(ReadOnlySpan<IOperand> value)
{
foreach (IOperand instruction in value)
{
@ -72,7 +72,7 @@ namespace Spv.Generator
}
}
public void AddOperand(LiteralInteger[] value)
public void AddOperand(ReadOnlySpan<LiteralInteger> value)
{
foreach (LiteralInteger instruction in value)
{
@ -85,7 +85,7 @@ namespace Spv.Generator
AddOperand((IOperand)value);
}
public void AddOperand(Instruction[] value)
public void AddOperand(ReadOnlySpan<Instruction> value)
{
foreach (Instruction instruction in value)
{

View file

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -132,7 +133,7 @@ namespace Spv.Generator
_typeDeclarationsList.Add(instruction);
}
public void AddEntryPoint(ExecutionModel executionModel, Instruction function, string name, params Instruction[] interfaces)
public void AddEntryPoint(ExecutionModel executionModel, Instruction function, string name, params ReadOnlySpan<Instruction> interfaces)
{
Debug.Assert(function.Opcode == Op.OpFunction);
@ -146,7 +147,7 @@ namespace Spv.Generator
_entrypoints.Add(entryPoint);
}
public void AddExecutionMode(Instruction function, ExecutionMode mode, params IOperand[] parameters)
public void AddExecutionMode(Instruction function, ExecutionMode mode, params ReadOnlySpan<IOperand> parameters)
{
Debug.Assert(function.Opcode == Op.OpFunction);
@ -228,7 +229,7 @@ namespace Spv.Generator
_constants.Add(key, constant);
}
public Instruction ExtInst(Instruction resultType, Instruction set, LiteralInteger instruction, params IOperand[] parameters)
public Instruction ExtInst(Instruction resultType, Instruction set, LiteralInteger instruction, params ReadOnlySpan<IOperand> parameters)
{
Instruction result = NewInstruction(Op.OpExtInst, GetNewId(), resultType);
@ -247,7 +248,7 @@ namespace Spv.Generator
}
// TODO: Find a way to make the auto generate one used.
public Instruction OpenClPrintf(Instruction resultType, Instruction format, params Instruction[] additionalarguments)
public Instruction OpenClPrintf(Instruction resultType, Instruction format, params ReadOnlySpan<Instruction> additionalarguments)
{
Instruction result = NewInstruction(Op.OpExtInst, GetNewId(), resultType);

View file

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>