0
0
Fork 0

[Spv.Generator] Address dotnet-format issues (#5394)

* dotnet format style --severity info

Some changes were manually reverted.

* Restore a few unused methods and variables

* Silence dotnet format IDE0052 warnings

* Address or silence dotnet format IDE1006 warnings

* Address or silence dotnet format CA1069 warnings

* Address review comments

* Address most dotnet format whitespace warnings

* Run dotnet format after rebase and remove unused usings

- analyzers
- style
- whitespace

* Add comments to disabled warnings

* Simplify properties and array initialization, Use const when possible, Remove trailing commas

* Address IDE0251 warnings

* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase

* Rename Operand.cs to IOperand.cs

* Update src/Spv.Generator/Module.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Remove NotNullWhen attribute and use conditional access to avoid NRE

* Fix duplicated enum values

* Remove unread member

---------

Co-authored-by: Ac_K <Acoustik666@gmail.com>
This commit is contained in:
TSRBerry 2023-06-28 18:54:20 +02:00 committed by GitHub
parent cebfa54467
commit 981e0c082d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 490 additions and 497 deletions

View file

@ -180,7 +180,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction Decorate(Instruction target, Decoration decoration, Operand parameter) public Instruction Decorate(Instruction target, Decoration decoration, IOperand parameter)
{ {
Instruction result = NewInstruction(Op.OpDecorate); Instruction result = NewInstruction(Op.OpDecorate);
@ -192,7 +192,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction Decorate(Instruction target, Decoration decoration, params Operand[] parameters) public Instruction Decorate(Instruction target, Decoration decoration, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpDecorate); Instruction result = NewInstruction(Op.OpDecorate);
@ -216,7 +216,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, Operand parameter) public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, IOperand parameter)
{ {
Instruction result = NewInstruction(Op.OpMemberDecorate); Instruction result = NewInstruction(Op.OpMemberDecorate);
@ -229,7 +229,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, params Operand[] parameters) public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpMemberDecorate); Instruction result = NewInstruction(Op.OpMemberDecorate);
@ -262,7 +262,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction GroupMemberDecorate(Instruction decorationGroup, params Operand[] targets) public Instruction GroupMemberDecorate(Instruction decorationGroup, params IOperand[] targets)
{ {
Instruction result = NewInstruction(Op.OpGroupMemberDecorate); Instruction result = NewInstruction(Op.OpGroupMemberDecorate);
@ -273,7 +273,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction DecorateId(Instruction target, Decoration decoration, params Operand[] parameters) public Instruction DecorateId(Instruction target, Decoration decoration, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpDecorateId); Instruction result = NewInstruction(Op.OpDecorateId);
@ -285,7 +285,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction DecorateString(Instruction target, Decoration decoration, params Operand[] parameters) public Instruction DecorateString(Instruction target, Decoration decoration, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpDecorateString); Instruction result = NewInstruction(Op.OpDecorateString);
@ -297,7 +297,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction DecorateStringGOOGLE(Instruction target, Decoration decoration, params Operand[] parameters) public Instruction DecorateStringGOOGLE(Instruction target, Decoration decoration, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpDecorateStringGOOGLE); Instruction result = NewInstruction(Op.OpDecorateStringGOOGLE);
@ -309,7 +309,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction MemberDecorateString(Instruction structType, LiteralInteger member, Decoration decoration, params Operand[] parameters) public Instruction MemberDecorateString(Instruction structType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpMemberDecorateString); Instruction result = NewInstruction(Op.OpMemberDecorateString);
@ -322,7 +322,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction MemberDecorateStringGOOGLE(Instruction structType, LiteralInteger member, Decoration decoration, params Operand[] parameters) public Instruction MemberDecorateStringGOOGLE(Instruction structType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpMemberDecorateStringGOOGLE); Instruction result = NewInstruction(Op.OpMemberDecorateStringGOOGLE);
@ -2815,7 +2815,7 @@ namespace Spv.Generator
return result; return result;
} }
public Instruction Switch(Instruction selector, Instruction defaultObj, params Operand[] target) public Instruction Switch(Instruction selector, Instruction defaultObj, params IOperand[] target)
{ {
Instruction result = NewInstruction(Op.OpSwitch); Instruction result = NewInstruction(Op.OpSwitch);

View file

@ -26,8 +26,6 @@
// IN THE MATERIALS. // IN THE MATERIALS.
#endregion #endregion
using static Spv.Specification;
namespace Spv.Generator namespace Spv.Generator
{ {
public partial class Module public partial class Module

View file

@ -3,7 +3,7 @@ using System.Diagnostics.CodeAnalysis;
namespace Spv.Generator namespace Spv.Generator
{ {
internal struct ConstantKey : IEquatable<ConstantKey> internal readonly struct ConstantKey : IEquatable<ConstantKey>
{ {
private readonly Instruction _constant; private readonly Instruction _constant;
@ -24,7 +24,7 @@ namespace Spv.Generator
public override bool Equals([NotNullWhen(true)] object obj) public override bool Equals([NotNullWhen(true)] object obj)
{ {
return obj is ConstantKey && Equals((ConstantKey)obj); return obj is ConstantKey key && Equals(key);
} }
} }
} }

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics.CodeAnalysis;
namespace Spv.Generator namespace Spv.Generator
{ {
@ -19,12 +18,12 @@ namespace Spv.Generator
public bool Equals(DeterministicStringKey other) public bool Equals(DeterministicStringKey other)
{ {
return _value == other._value; return _value == other?._value;
} }
public override bool Equals([NotNullWhen(true)] object obj) public override bool Equals(object obj)
{ {
return obj is DeterministicStringKey && Equals((DeterministicStringKey)obj); return obj is DeterministicStringKey key && Equals(key);
} }
} }
} }

View file

@ -4,17 +4,15 @@ namespace Spv.Generator
{ {
public class GeneratorPool<T> where T : class, new() public class GeneratorPool<T> where T : class, new()
{ {
private List<T[]> _pool; private readonly List<T[]> _pool;
private int _chunkIndex = -1; private int _chunkIndex = -1;
private int _poolIndex = -1; private int _poolIndex = -1;
private int _initialSize; private readonly int _poolSizeIncrement;
private int _poolSizeIncrement;
public GeneratorPool(): this(1000, 200) { } public GeneratorPool() : this(1000, 200) { }
public GeneratorPool(int chunkSizeLimit, int poolSizeIncrement) public GeneratorPool(int chunkSizeLimit, int poolSizeIncrement)
{ {
_initialSize = chunkSizeLimit;
_poolSizeIncrement = poolSizeIncrement; _poolSizeIncrement = poolSizeIncrement;
_pool = new(chunkSizeLimit * 2); _pool = new(chunkSizeLimit * 2);

View file

@ -3,7 +3,7 @@ using System.IO;
namespace Spv.Generator namespace Spv.Generator
{ {
public interface Operand : IEquatable<Operand> public interface IOperand : IEquatable<IOperand>
{ {
OperandType Type { get; } OperandType Type { get; }

View file

@ -5,7 +5,7 @@ using System.IO;
namespace Spv.Generator namespace Spv.Generator
{ {
public sealed class Instruction : Operand, IEquatable<Instruction> public sealed class Instruction : IOperand, IEquatable<Instruction>
{ {
public const uint InvalidId = uint.MaxValue; public const uint InvalidId = uint.MaxValue;
@ -47,7 +47,7 @@ namespace Spv.Generator
result += _resultType.WordCount; result += _resultType.WordCount;
} }
Span<Operand> operands = _operands.AsSpan(); Span<IOperand> operands = _operands.AsSpan();
for (int i = 0; i < operands.Length; i++) for (int i = 0; i < operands.Length; i++)
{ {
result += operands[i].WordCount; result += operands[i].WordCount;
@ -58,15 +58,15 @@ namespace Spv.Generator
public ushort WordCount => 1; public ushort WordCount => 1;
public void AddOperand(Operand value) public void AddOperand(IOperand value)
{ {
Debug.Assert(value != null); Debug.Assert(value != null);
_operands.Add(value); _operands.Add(value);
} }
public void AddOperand(Operand[] value) public void AddOperand(IOperand[] value)
{ {
foreach (Operand instruction in value) foreach (IOperand instruction in value)
{ {
AddOperand(instruction); AddOperand(instruction);
} }
@ -82,7 +82,7 @@ namespace Spv.Generator
public void AddOperand(LiteralInteger value) public void AddOperand(LiteralInteger value)
{ {
AddOperand((Operand)value); AddOperand((IOperand)value);
} }
public void AddOperand(Instruction[] value) public void AddOperand(Instruction[] value)
@ -95,7 +95,7 @@ namespace Spv.Generator
public void AddOperand(Instruction value) public void AddOperand(Instruction value)
{ {
AddOperand((Operand)value); AddOperand((IOperand)value);
} }
public void AddOperand(string value) public void AddOperand(string value)
@ -103,7 +103,7 @@ namespace Spv.Generator
AddOperand(new LiteralString(value)); AddOperand(new LiteralString(value));
} }
public void AddOperand<T>(T value) where T: Enum public void AddOperand<T>(T value) where T : Enum
{ {
AddOperand(LiteralInteger.CreateForEnum(value)); AddOperand(LiteralInteger.CreateForEnum(value));
} }
@ -121,7 +121,7 @@ namespace Spv.Generator
writer.Write(Id); writer.Write(Id);
} }
Span<Operand> operands = _operands.AsSpan(); Span<IOperand> operands = _operands.AsSpan();
for (int i = 0; i < operands.Length; i++) for (int i = 0; i < operands.Length; i++)
{ {
operands[i].WriteOperand(writer); operands[i].WriteOperand(writer);
@ -186,8 +186,8 @@ namespace Spv.Generator
public bool EqualsContent(Instruction cmpObj) public bool EqualsContent(Instruction cmpObj)
{ {
Span<Operand> thisOperands = _operands.AsSpan(); Span<IOperand> thisOperands = _operands.AsSpan();
Span<Operand> cmpOperands = cmpObj._operands.AsSpan(); Span<IOperand> cmpOperands = cmpObj._operands.AsSpan();
if (thisOperands.Length != cmpOperands.Length) if (thisOperands.Length != cmpOperands.Length)
{ {
@ -212,7 +212,7 @@ namespace Spv.Generator
public int GetHashCodeContent() public int GetHashCodeContent()
{ {
return DeterministicHashCode.Combine<Operand>(_operands.AsSpan()); return DeterministicHashCode.Combine<IOperand>(_operands.AsSpan());
} }
public int GetHashCodeResultType() public int GetHashCodeResultType()
@ -222,10 +222,10 @@ namespace Spv.Generator
public override int GetHashCode() public override int GetHashCode()
{ {
return DeterministicHashCode.Combine(Opcode, Id, _resultType, DeterministicHashCode.Combine<Operand>(_operands.AsSpan())); return DeterministicHashCode.Combine(Opcode, Id, _resultType, DeterministicHashCode.Combine<IOperand>(_operands.AsSpan()));
} }
public bool Equals(Operand obj) public bool Equals(IOperand obj)
{ {
return obj is Instruction instruction && Equals(instruction); return obj is Instruction instruction && Equals(instruction);
} }

View file

@ -10,14 +10,14 @@ namespace Spv.Generator
private const int InternalCount = 5; private const int InternalCount = 5;
public int Count; public int Count;
public Operand Operand1; public IOperand Operand1;
public Operand Operand2; public IOperand Operand2;
public Operand Operand3; public IOperand Operand3;
public Operand Operand4; public IOperand Operand4;
public Operand Operand5; public IOperand Operand5;
public Operand[] Overflow; public IOperand[] Overflow;
public Span<Operand> AsSpan() public Span<IOperand> AsSpan()
{ {
if (Count > InternalCount) if (Count > InternalCount)
{ {
@ -29,7 +29,7 @@ namespace Spv.Generator
} }
} }
public void Add(Operand operand) public void Add(IOperand operand)
{ {
if (Count < InternalCount) if (Count < InternalCount)
{ {
@ -40,7 +40,7 @@ namespace Spv.Generator
{ {
if (Overflow == null) if (Overflow == null)
{ {
Overflow = new Operand[InternalCount * 2]; Overflow = new IOperand[InternalCount * 2];
MemoryMarshal.CreateSpan(ref this.Operand1, InternalCount).CopyTo(Overflow.AsSpan()); MemoryMarshal.CreateSpan(ref this.Operand1, InternalCount).CopyTo(Overflow.AsSpan());
} }
else if (Count == Overflow.Length) else if (Count == Overflow.Length)
@ -52,16 +52,16 @@ namespace Spv.Generator
} }
} }
private IEnumerable<Operand> AllOperands => new[] { Operand1, Operand2, Operand3, Operand4, Operand5 } private readonly IEnumerable<IOperand> AllOperands => new[] { Operand1, Operand2, Operand3, Operand4, Operand5 }
.Concat(Overflow ?? Array.Empty<Operand>()) .Concat(Overflow ?? Array.Empty<IOperand>())
.Take(Count); .Take(Count);
public override string ToString() public readonly override string ToString()
{ {
return $"({string.Join(", ", AllOperands)})"; return $"({string.Join(", ", AllOperands)})";
} }
public string ToString(string[] labels) public readonly string ToString(string[] labels)
{ {
var labeledParams = AllOperands.Zip(labels, (op, label) => $"{label}: {op}"); var labeledParams = AllOperands.Zip(labels, (op, label) => $"{label}: {op}");
var unlabeledParams = AllOperands.Skip(labels.Length).Select(op => op.ToString()); var unlabeledParams = AllOperands.Skip(labels.Length).Select(op => op.ToString());

View file

@ -3,7 +3,7 @@ using System.IO;
namespace Spv.Generator namespace Spv.Generator
{ {
public class LiteralInteger : Operand, IEquatable<LiteralInteger> public class LiteralInteger : IOperand, IEquatable<LiteralInteger>
{ {
[ThreadStatic] [ThreadStatic]
private static GeneratorPool<LiteralInteger> _pool; private static GeneratorPool<LiteralInteger> _pool;
@ -95,7 +95,7 @@ namespace Spv.Generator
return DeterministicHashCode.Combine(Type, _data); return DeterministicHashCode.Combine(Type, _data);
} }
public bool Equals(Operand obj) public bool Equals(IOperand obj)
{ {
return obj is LiteralInteger literalInteger && Equals(literalInteger); return obj is LiteralInteger literalInteger && Equals(literalInteger);
} }

View file

@ -4,7 +4,7 @@ using System.Text;
namespace Spv.Generator namespace Spv.Generator
{ {
public class LiteralString : Operand, IEquatable<LiteralString> public class LiteralString : IOperand, IEquatable<LiteralString>
{ {
public OperandType Type => OperandType.String; public OperandType Type => OperandType.String;
@ -44,7 +44,7 @@ namespace Spv.Generator
return DeterministicHashCode.Combine(Type, DeterministicHashCode.GetHashCode(_value)); return DeterministicHashCode.Combine(Type, DeterministicHashCode.GetHashCode(_value));
} }
public bool Equals(Operand obj) public bool Equals(IOperand obj)
{ {
return obj is LiteralString literalString && Equals(literalString); return obj is LiteralString literalString && Equals(literalString);
} }

View file

@ -15,30 +15,30 @@ namespace Spv.Generator
private uint _bound; private uint _bound;
// Follow spec order here while keeping it as simple as possible. // Follow spec order here while keeping it as simple as possible.
private List<Capability> _capabilities; private readonly List<Capability> _capabilities;
private List<string> _extensions; private readonly List<string> _extensions;
private Dictionary<DeterministicStringKey, Instruction> _extInstImports; private readonly Dictionary<DeterministicStringKey, Instruction> _extInstImports;
private AddressingModel _addressingModel; private AddressingModel _addressingModel;
private MemoryModel _memoryModel; private MemoryModel _memoryModel;
private List<Instruction> _entrypoints; private readonly List<Instruction> _entrypoints;
private List<Instruction> _executionModes; private readonly List<Instruction> _executionModes;
private List<Instruction> _debug; private readonly List<Instruction> _debug;
private List<Instruction> _annotations; private readonly List<Instruction> _annotations;
// In the declaration block. // In the declaration block.
private Dictionary<TypeDeclarationKey, Instruction> _typeDeclarations; private readonly Dictionary<TypeDeclarationKey, Instruction> _typeDeclarations;
// In the declaration block. // In the declaration block.
private List<Instruction> _globals; private readonly List<Instruction> _globals;
// In the declaration block. // In the declaration block.
private Dictionary<ConstantKey, Instruction> _constants; private readonly Dictionary<ConstantKey, Instruction> _constants;
// In the declaration block, for function that aren't defined in the module. // In the declaration block, for function that aren't defined in the module.
private List<Instruction> _functionsDeclarations; private readonly List<Instruction> _functionsDeclarations;
private List<Instruction> _functionsDefinitions; private readonly List<Instruction> _functionsDefinitions;
private GeneratorPool<Instruction> _instPool; private readonly GeneratorPool<Instruction> _instPool;
private GeneratorPool<LiteralInteger> _integerPool; private readonly GeneratorPool<LiteralInteger> _integerPool;
public Module(uint version, GeneratorPool<Instruction> instPool = null, GeneratorPool<LiteralInteger> integerPool = null) public Module(uint version, GeneratorPool<Instruction> instPool = null, GeneratorPool<LiteralInteger> integerPool = null)
{ {
@ -143,7 +143,7 @@ namespace Spv.Generator
_entrypoints.Add(entryPoint); _entrypoints.Add(entryPoint);
} }
public void AddExecutionMode(Instruction function, ExecutionMode mode, params Operand[] parameters) public void AddExecutionMode(Instruction function, ExecutionMode mode, params IOperand[] parameters)
{ {
Debug.Assert(function.Opcode == Op.OpFunction); Debug.Assert(function.Opcode == Op.OpFunction);
@ -225,7 +225,7 @@ namespace Spv.Generator
_constants.Add(key, constant); _constants.Add(key, constant);
} }
public Instruction ExtInst(Instruction resultType, Instruction set, LiteralInteger instruction, params Operand[] parameters) public Instruction ExtInst(Instruction resultType, Instruction set, LiteralInteger instruction, params IOperand[] parameters)
{ {
Instruction result = NewInstruction(Op.OpExtInst, GetNewId(), resultType); Instruction result = NewInstruction(Op.OpExtInst, GetNewId(), resultType);
@ -262,9 +262,9 @@ namespace Spv.Generator
// Estimate the size needed for the generated code, to avoid expanding the MemoryStream. // Estimate the size needed for the generated code, to avoid expanding the MemoryStream.
int sizeEstimate = 1024 + _functionsDefinitions.Count * 32; int sizeEstimate = 1024 + _functionsDefinitions.Count * 32;
using (MemoryStream stream = new MemoryStream(sizeEstimate)) using MemoryStream stream = new(sizeEstimate);
{
BinaryWriter writer = new BinaryWriter(stream, System.Text.Encoding.ASCII); BinaryWriter writer = new(stream, System.Text.Encoding.ASCII);
// Header // Header
writer.Write(MagicNumber); writer.Write(MagicNumber);
@ -329,7 +329,7 @@ namespace Spv.Generator
} }
// Ensure that everything is in the right order in the declarations section. // Ensure that everything is in the right order in the declarations section.
List<Instruction> declarations = new List<Instruction>(); List<Instruction> declarations = new();
declarations.AddRange(_typeDeclarations.Values); declarations.AddRange(_typeDeclarations.Values);
declarations.AddRange(_globals); declarations.AddRange(_globals);
declarations.AddRange(_constants.Values); declarations.AddRange(_constants.Values);
@ -361,5 +361,4 @@ namespace Spv.Generator
return stream.ToArray(); return stream.ToArray();
} }
} }
}
} }

View file

@ -3,7 +3,7 @@ using System.Diagnostics.CodeAnalysis;
namespace Spv.Generator namespace Spv.Generator
{ {
internal struct TypeDeclarationKey : IEquatable<TypeDeclarationKey> internal readonly struct TypeDeclarationKey : IEquatable<TypeDeclarationKey>
{ {
private readonly Instruction _typeDeclaration; private readonly Instruction _typeDeclaration;
@ -24,7 +24,7 @@ namespace Spv.Generator
public override bool Equals([NotNullWhen(true)] object obj) public override bool Equals([NotNullWhen(true)] object obj)
{ {
return obj is TypeDeclarationKey && Equals((TypeDeclarationKey)obj); return obj is TypeDeclarationKey key && Equals(key);
} }
} }
} }

View file

@ -75,17 +75,17 @@ namespace Spv
TaskNV = 5267, TaskNV = 5267,
MeshNV = 5268, MeshNV = 5268,
RayGenerationKHR = 5313, RayGenerationKHR = 5313,
RayGenerationNV = 5313, RayGenerationNV = RayGenerationKHR,
IntersectionKHR = 5314, IntersectionKHR = 5314,
IntersectionNV = 5314, IntersectionNV = IntersectionKHR,
AnyHitKHR = 5315, AnyHitKHR = 5315,
AnyHitNV = 5315, AnyHitNV = AnyHitKHR,
ClosestHitKHR = 5316, ClosestHitKHR = 5316,
ClosestHitNV = 5316, ClosestHitNV = ClosestHitKHR,
MissKHR = 5317, MissKHR = 5317,
MissNV = 5317, MissNV = MissKHR,
CallableKHR = 5318, CallableKHR = 5318,
CallableNV = 5318, CallableNV = CallableKHR,
} }
public enum AddressingModel public enum AddressingModel
@ -94,7 +94,7 @@ namespace Spv
Physical32 = 1, Physical32 = 1,
Physical64 = 2, Physical64 = 2,
PhysicalStorageBuffer64 = 5348, PhysicalStorageBuffer64 = 5348,
PhysicalStorageBuffer64EXT = 5348, PhysicalStorageBuffer64EXT = PhysicalStorageBuffer64,
} }
public enum MemoryModel public enum MemoryModel
@ -103,7 +103,7 @@ namespace Spv
GLSL450 = 1, GLSL450 = 1,
OpenCL = 2, OpenCL = 2,
Vulkan = 3, Vulkan = 3,
VulkanKHR = 3, VulkanKHR = Vulkan,
} }
public enum ExecutionMode public enum ExecutionMode
@ -186,19 +186,19 @@ namespace Spv
Image = 11, Image = 11,
StorageBuffer = 12, StorageBuffer = 12,
CallableDataKHR = 5328, CallableDataKHR = 5328,
CallableDataNV = 5328, CallableDataNV = CallableDataKHR,
IncomingCallableDataKHR = 5329, IncomingCallableDataKHR = 5329,
IncomingCallableDataNV = 5329, IncomingCallableDataNV = IncomingCallableDataKHR,
RayPayloadKHR = 5338, RayPayloadKHR = 5338,
RayPayloadNV = 5338, RayPayloadNV = RayPayloadKHR,
HitAttributeKHR = 5339, HitAttributeKHR = 5339,
HitAttributeNV = 5339, HitAttributeNV = HitAttributeKHR,
IncomingRayPayloadKHR = 5342, IncomingRayPayloadKHR = 5342,
IncomingRayPayloadNV = 5342, IncomingRayPayloadNV = IncomingRayPayloadKHR,
ShaderRecordBufferKHR = 5343, ShaderRecordBufferKHR = 5343,
ShaderRecordBufferNV = 5343, ShaderRecordBufferNV = ShaderRecordBufferKHR,
PhysicalStorageBuffer = 5349, PhysicalStorageBuffer = 5349,
PhysicalStorageBufferEXT = 5349, PhysicalStorageBufferEXT = PhysicalStorageBuffer,
CodeSectionINTEL = 5605, CodeSectionINTEL = 5605,
} }
@ -330,13 +330,13 @@ namespace Spv
Sample = 6, Sample = 6,
MinLod = 7, MinLod = 7,
MakeTexelAvailable = 8, MakeTexelAvailable = 8,
MakeTexelAvailableKHR = 8, MakeTexelAvailableKHR = MakeTexelAvailable,
MakeTexelVisible = 9, MakeTexelVisible = 9,
MakeTexelVisibleKHR = 9, MakeTexelVisibleKHR = MakeTexelVisible,
NonPrivateTexel = 10, NonPrivateTexel = 10,
NonPrivateTexelKHR = 10, NonPrivateTexelKHR = NonPrivateTexel,
VolatileTexel = 11, VolatileTexel = 11,
VolatileTexelKHR = 11, VolatileTexelKHR = VolatileTexel,
SignExtend = 12, SignExtend = 12,
ZeroExtend = 13, ZeroExtend = 13,
} }
@ -353,13 +353,13 @@ namespace Spv
Sample = 0x00000040, Sample = 0x00000040,
MinLod = 0x00000080, MinLod = 0x00000080,
MakeTexelAvailable = 0x00000100, MakeTexelAvailable = 0x00000100,
MakeTexelAvailableKHR = 0x00000100, MakeTexelAvailableKHR = MakeTexelAvailable,
MakeTexelVisible = 0x00000200, MakeTexelVisible = 0x00000200,
MakeTexelVisibleKHR = 0x00000200, MakeTexelVisibleKHR = MakeTexelVisible,
NonPrivateTexel = 0x00000400, NonPrivateTexel = 0x00000400,
NonPrivateTexelKHR = 0x00000400, NonPrivateTexelKHR = NonPrivateTexel,
VolatileTexel = 0x00000800, VolatileTexel = 0x00000800,
VolatileTexelKHR = 0x00000800, VolatileTexelKHR = VolatileTexel,
SignExtend = 0x00001000, SignExtend = 0x00001000,
ZeroExtend = 0x00002000, ZeroExtend = 0x00002000,
Offsets = 0x00010000, Offsets = 0x00010000,
@ -478,16 +478,16 @@ namespace Spv
PerTaskNV = 5273, PerTaskNV = 5273,
PerVertexNV = 5285, PerVertexNV = 5285,
NonUniform = 5300, NonUniform = 5300,
NonUniformEXT = 5300, NonUniformEXT = NonUniform,
RestrictPointer = 5355, RestrictPointer = 5355,
RestrictPointerEXT = 5355, RestrictPointerEXT = RestrictPointer,
AliasedPointer = 5356, AliasedPointer = 5356,
AliasedPointerEXT = 5356, AliasedPointerEXT = AliasedPointer,
ReferencedIndirectlyINTEL = 5602, ReferencedIndirectlyINTEL = 5602,
CounterBuffer = 5634, CounterBuffer = 5634,
HlslCounterBufferGOOGLE = 5634, HlslCounterBufferGOOGLE = CounterBuffer,
HlslSemanticGOOGLE = 5635, HlslSemanticGOOGLE = 5635,
UserSemantic = 5635, UserSemantic = HlslSemanticGOOGLE,
UserTypeGOOGLE = 5636, UserTypeGOOGLE = 5636,
RegisterINTEL = 5825, RegisterINTEL = 5825,
MemoryINTEL = 5826, MemoryINTEL = 5826,
@ -547,15 +547,15 @@ namespace Spv
VertexIndex = 42, VertexIndex = 42,
InstanceIndex = 43, InstanceIndex = 43,
SubgroupEqMask = 4416, SubgroupEqMask = 4416,
SubgroupEqMaskKHR = 4416, SubgroupEqMaskKHR = SubgroupEqMask,
SubgroupGeMask = 4417, SubgroupGeMask = 4417,
SubgroupGeMaskKHR = 4417, SubgroupGeMaskKHR = SubgroupGeMask,
SubgroupGtMask = 4418, SubgroupGtMask = 4418,
SubgroupGtMaskKHR = 4418, SubgroupGtMaskKHR = SubgroupGtMask,
SubgroupLeMask = 4419, SubgroupLeMask = 4419,
SubgroupLeMaskKHR = 4419, SubgroupLeMaskKHR = SubgroupLeMask,
SubgroupLtMask = 4420, SubgroupLtMask = 4420,
SubgroupLtMaskKHR = 4420, SubgroupLtMaskKHR = SubgroupLtMask,
BaseVertex = 4424, BaseVertex = 4424,
BaseInstance = 4425, BaseInstance = 4425,
DrawIndex = 4426, DrawIndex = 4426,
@ -588,36 +588,36 @@ namespace Spv
BaryCoordNV = 5286, BaryCoordNV = 5286,
BaryCoordNoPerspNV = 5287, BaryCoordNoPerspNV = 5287,
FragSizeEXT = 5292, FragSizeEXT = 5292,
FragmentSizeNV = 5292, FragmentSizeNV = FragSizeEXT,
FragInvocationCountEXT = 5293, FragInvocationCountEXT = 5293,
InvocationsPerPixelNV = 5293, InvocationsPerPixelNV = FragInvocationCountEXT,
LaunchIdKHR = 5319, LaunchIdKHR = 5319,
LaunchIdNV = 5319, LaunchIdNV = LaunchIdKHR,
LaunchSizeKHR = 5320, LaunchSizeKHR = 5320,
LaunchSizeNV = 5320, LaunchSizeNV = LaunchSizeKHR,
WorldRayOriginKHR = 5321, WorldRayOriginKHR = 5321,
WorldRayOriginNV = 5321, WorldRayOriginNV = WorldRayOriginKHR,
WorldRayDirectionKHR = 5322, WorldRayDirectionKHR = 5322,
WorldRayDirectionNV = 5322, WorldRayDirectionNV = WorldRayDirectionKHR,
ObjectRayOriginKHR = 5323, ObjectRayOriginKHR = 5323,
ObjectRayOriginNV = 5323, ObjectRayOriginNV = ObjectRayOriginKHR,
ObjectRayDirectionKHR = 5324, ObjectRayDirectionKHR = 5324,
ObjectRayDirectionNV = 5324, ObjectRayDirectionNV = ObjectRayDirectionKHR,
RayTminKHR = 5325, RayTminKHR = 5325,
RayTminNV = 5325, RayTminNV = RayTminKHR,
RayTmaxKHR = 5326, RayTmaxKHR = 5326,
RayTmaxNV = 5326, RayTmaxNV = RayTmaxKHR,
InstanceCustomIndexKHR = 5327, InstanceCustomIndexKHR = 5327,
InstanceCustomIndexNV = 5327, InstanceCustomIndexNV = InstanceCustomIndexKHR,
ObjectToWorldKHR = 5330, ObjectToWorldKHR = 5330,
ObjectToWorldNV = 5330, ObjectToWorldNV = ObjectToWorldKHR,
WorldToObjectKHR = 5331, WorldToObjectKHR = 5331,
WorldToObjectNV = 5331, WorldToObjectNV = WorldToObjectKHR,
HitTNV = 5332, HitTNV = 5332,
HitKindKHR = 5333, HitKindKHR = 5333,
HitKindNV = 5333, HitKindNV = HitKindKHR,
IncomingRayFlagsKHR = 5351, IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351, IncomingRayFlagsNV = IncomingRayFlagsKHR,
RayGeometryIndexKHR = 5352, RayGeometryIndexKHR = 5352,
WarpsPerSMNV = 5374, WarpsPerSMNV = 5374,
SMCountNV = 5375, SMCountNV = 5375,
@ -709,11 +709,11 @@ namespace Spv
AtomicCounterMemory = 10, AtomicCounterMemory = 10,
ImageMemory = 11, ImageMemory = 11,
OutputMemory = 12, OutputMemory = 12,
OutputMemoryKHR = 12, OutputMemoryKHR = OutputMemory,
MakeAvailable = 13, MakeAvailable = 13,
MakeAvailableKHR = 13, MakeAvailableKHR = MakeAvailable,
MakeVisible = 14, MakeVisible = 14,
MakeVisibleKHR = 14, MakeVisibleKHR = MakeVisible,
Volatile = 15, Volatile = 15,
} }
@ -731,11 +731,11 @@ namespace Spv
AtomicCounterMemory = 0x00000400, AtomicCounterMemory = 0x00000400,
ImageMemory = 0x00000800, ImageMemory = 0x00000800,
OutputMemory = 0x00001000, OutputMemory = 0x00001000,
OutputMemoryKHR = 0x00001000, OutputMemoryKHR = OutputMemory,
MakeAvailable = 0x00002000, MakeAvailable = 0x00002000,
MakeAvailableKHR = 0x00002000, MakeAvailableKHR = MakeAvailable,
MakeVisible = 0x00004000, MakeVisible = 0x00004000,
MakeVisibleKHR = 0x00004000, MakeVisibleKHR = MakeVisible,
Volatile = 0x00008000, Volatile = 0x00008000,
} }
@ -745,11 +745,11 @@ namespace Spv
Aligned = 1, Aligned = 1,
Nontemporal = 2, Nontemporal = 2,
MakePointerAvailable = 3, MakePointerAvailable = 3,
MakePointerAvailableKHR = 3, MakePointerAvailableKHR = MakePointerAvailable,
MakePointerVisible = 4, MakePointerVisible = 4,
MakePointerVisibleKHR = 4, MakePointerVisibleKHR = MakePointerVisible,
NonPrivatePointer = 5, NonPrivatePointer = 5,
NonPrivatePointerKHR = 5, NonPrivatePointerKHR = NonPrivatePointer,
} }
public enum MemoryAccessMask public enum MemoryAccessMask
@ -759,11 +759,11 @@ namespace Spv
Aligned = 0x00000002, Aligned = 0x00000002,
Nontemporal = 0x00000004, Nontemporal = 0x00000004,
MakePointerAvailable = 0x00000008, MakePointerAvailable = 0x00000008,
MakePointerAvailableKHR = 0x00000008, MakePointerAvailableKHR = MakePointerAvailable,
MakePointerVisible = 0x00000010, MakePointerVisible = 0x00000010,
MakePointerVisibleKHR = 0x00000010, MakePointerVisibleKHR = MakePointerVisible,
NonPrivatePointer = 0x00000020, NonPrivatePointer = 0x00000020,
NonPrivatePointerKHR = 0x00000020, NonPrivatePointerKHR = NonPrivatePointer,
} }
public enum Scope public enum Scope
@ -774,7 +774,7 @@ namespace Spv
Subgroup = 3, Subgroup = 3,
Invocation = 4, Invocation = 4,
QueueFamily = 5, QueueFamily = 5,
QueueFamilyKHR = 5, QueueFamilyKHR = QueueFamily,
ShaderCallKHR = 6, ShaderCallKHR = 6,
} }
@ -883,9 +883,9 @@ namespace Spv
DrawParameters = 4427, DrawParameters = 4427,
SubgroupVoteKHR = 4431, SubgroupVoteKHR = 4431,
StorageBuffer16BitAccess = 4433, StorageBuffer16BitAccess = 4433,
StorageUniformBufferBlock16 = 4433, StorageUniformBufferBlock16 = StorageBuffer16BitAccess,
StorageUniform16 = 4434, StorageUniform16 = 4434,
UniformAndStorageBuffer16BitAccess = 4434, UniformAndStorageBuffer16BitAccess = StorageUniform16,
StoragePushConstant16 = 4435, StoragePushConstant16 = 4435,
StorageInputOutput16 = 4436, StorageInputOutput16 = 4436,
DeviceGroup = 4437, DeviceGroup = 4437,
@ -916,7 +916,7 @@ namespace Spv
SampleMaskOverrideCoverageNV = 5249, SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251, GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254, ShaderViewportIndexLayerEXT = 5254,
ShaderViewportIndexLayerNV = 5254, ShaderViewportIndexLayerNV = ShaderViewportIndexLayerEXT,
ShaderViewportMaskNV = 5255, ShaderViewportMaskNV = 5255,
ShaderStereoViewNV = 5259, ShaderStereoViewNV = 5259,
PerViewAttributesNV = 5260, PerViewAttributesNV = 5260,
@ -926,39 +926,39 @@ namespace Spv
FragmentBarycentricNV = 5284, FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288, ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291, FragmentDensityEXT = 5291,
ShadingRateNV = 5291, ShadingRateNV = FragmentDensityEXT,
GroupNonUniformPartitionedNV = 5297, GroupNonUniformPartitionedNV = 5297,
ShaderNonUniform = 5301, ShaderNonUniform = 5301,
ShaderNonUniformEXT = 5301, ShaderNonUniformEXT = ShaderNonUniform,
RuntimeDescriptorArray = 5302, RuntimeDescriptorArray = 5302,
RuntimeDescriptorArrayEXT = 5302, RuntimeDescriptorArrayEXT = RuntimeDescriptorArray,
InputAttachmentArrayDynamicIndexing = 5303, InputAttachmentArrayDynamicIndexing = 5303,
InputAttachmentArrayDynamicIndexingEXT = 5303, InputAttachmentArrayDynamicIndexingEXT = InputAttachmentArrayDynamicIndexing,
UniformTexelBufferArrayDynamicIndexing = 5304, UniformTexelBufferArrayDynamicIndexing = 5304,
UniformTexelBufferArrayDynamicIndexingEXT = 5304, UniformTexelBufferArrayDynamicIndexingEXT = UniformTexelBufferArrayDynamicIndexing,
StorageTexelBufferArrayDynamicIndexing = 5305, StorageTexelBufferArrayDynamicIndexing = 5305,
StorageTexelBufferArrayDynamicIndexingEXT = 5305, StorageTexelBufferArrayDynamicIndexingEXT = StorageTexelBufferArrayDynamicIndexing,
UniformBufferArrayNonUniformIndexing = 5306, UniformBufferArrayNonUniformIndexing = 5306,
UniformBufferArrayNonUniformIndexingEXT = 5306, UniformBufferArrayNonUniformIndexingEXT = UniformBufferArrayNonUniformIndexing,
SampledImageArrayNonUniformIndexing = 5307, SampledImageArrayNonUniformIndexing = 5307,
SampledImageArrayNonUniformIndexingEXT = 5307, SampledImageArrayNonUniformIndexingEXT = SampledImageArrayNonUniformIndexing,
StorageBufferArrayNonUniformIndexing = 5308, StorageBufferArrayNonUniformIndexing = 5308,
StorageBufferArrayNonUniformIndexingEXT = 5308, StorageBufferArrayNonUniformIndexingEXT = StorageBufferArrayNonUniformIndexing,
StorageImageArrayNonUniformIndexing = 5309, StorageImageArrayNonUniformIndexing = 5309,
StorageImageArrayNonUniformIndexingEXT = 5309, StorageImageArrayNonUniformIndexingEXT = StorageImageArrayNonUniformIndexing,
InputAttachmentArrayNonUniformIndexing = 5310, InputAttachmentArrayNonUniformIndexing = 5310,
InputAttachmentArrayNonUniformIndexingEXT = 5310, InputAttachmentArrayNonUniformIndexingEXT = InputAttachmentArrayNonUniformIndexing,
UniformTexelBufferArrayNonUniformIndexing = 5311, UniformTexelBufferArrayNonUniformIndexing = 5311,
UniformTexelBufferArrayNonUniformIndexingEXT = 5311, UniformTexelBufferArrayNonUniformIndexingEXT = UniformTexelBufferArrayNonUniformIndexing,
StorageTexelBufferArrayNonUniformIndexing = 5312, StorageTexelBufferArrayNonUniformIndexing = 5312,
StorageTexelBufferArrayNonUniformIndexingEXT = 5312, StorageTexelBufferArrayNonUniformIndexingEXT = StorageTexelBufferArrayNonUniformIndexing,
RayTracingNV = 5340, RayTracingNV = 5340,
VulkanMemoryModel = 5345, VulkanMemoryModel = 5345,
VulkanMemoryModelKHR = 5345, VulkanMemoryModelKHR = VulkanMemoryModel,
VulkanMemoryModelDeviceScope = 5346, VulkanMemoryModelDeviceScope = 5346,
VulkanMemoryModelDeviceScopeKHR = 5346, VulkanMemoryModelDeviceScopeKHR = VulkanMemoryModelDeviceScope,
PhysicalStorageBufferAddresses = 5347, PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347, PhysicalStorageBufferAddressesEXT = PhysicalStorageBufferAddresses,
ComputeDerivativeGroupLinearNV = 5350, ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353, RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357, CooperativeMatrixNV = 5357,
@ -1433,12 +1433,12 @@ namespace Spv
OpGroupNonUniformPartitionNV = 5296, OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299, OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334, OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334, OpReportIntersectionNV = OpReportIntersectionKHR,
OpIgnoreIntersectionNV = 5335, OpIgnoreIntersectionNV = 5335,
OpTerminateRayNV = 5336, OpTerminateRayNV = 5336,
OpTraceNV = 5337, OpTraceNV = 5337,
OpTypeAccelerationStructureKHR = 5341, OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341, OpTypeAccelerationStructureNV = OpTypeAccelerationStructureKHR,
OpExecuteCallableNV = 5344, OpExecuteCallableNV = 5344,
OpTypeCooperativeMatrixNV = 5358, OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359, OpCooperativeMatrixLoadNV = 5359,
@ -1476,9 +1476,9 @@ namespace Spv
OpFunctionPointerINTEL = 5600, OpFunctionPointerINTEL = 5600,
OpFunctionPointerCallINTEL = 5601, OpFunctionPointerCallINTEL = 5601,
OpDecorateString = 5632, OpDecorateString = 5632,
OpDecorateStringGOOGLE = 5632, OpDecorateStringGOOGLE = OpDecorateString,
OpMemberDecorateString = 5633, OpMemberDecorateString = 5633,
OpMemberDecorateStringGOOGLE = 5633, OpMemberDecorateStringGOOGLE = OpMemberDecorateString,
OpVmeImageINTEL = 5699, OpVmeImageINTEL = 5699,
OpTypeVmeImageINTEL = 5700, OpTypeVmeImageINTEL = 5700,
OpTypeAvcImePayloadINTEL = 5701, OpTypeAvcImePayloadINTEL = 5701,
@ -1622,4 +1622,3 @@ namespace Spv
} }
} }
} }