aboutsummaryrefslogtreecommitdiff
path: root/src/Spv.Generator/Module.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-08-16 18:16:25 -0300
committerGitHub <noreply@github.com>2023-08-16 23:16:25 +0200
commit17354d59d14680258186168c1c462654665ee8c7 (patch)
tree0c92f76d961d6a0257fa4c56132b1f1520cfc590 /src/Spv.Generator/Module.cs
parent0c445184c185f6cd4b870d88b5eaad46c633b83b (diff)
Declare and use gl_PerVertex block for VTG per-vertex built-ins (#5576)1.1.993
* Declare and use gl_PerVertex block for VTG per-vertex built-ins * Shader cache version bump
Diffstat (limited to 'src/Spv.Generator/Module.cs')
-rw-r--r--src/Spv.Generator/Module.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Spv.Generator/Module.cs b/src/Spv.Generator/Module.cs
index 5e1a9123..19328410 100644
--- a/src/Spv.Generator/Module.cs
+++ b/src/Spv.Generator/Module.cs
@@ -28,6 +28,7 @@ namespace Spv.Generator
// In the declaration block.
private readonly Dictionary<TypeDeclarationKey, Instruction> _typeDeclarations;
+ private readonly List<Instruction> _typeDeclarationsList;
// In the declaration block.
private readonly List<Instruction> _globals;
// In the declaration block.
@@ -54,6 +55,7 @@ namespace Spv.Generator
_debug = new List<Instruction>();
_annotations = new List<Instruction>();
_typeDeclarations = new Dictionary<TypeDeclarationKey, Instruction>();
+ _typeDeclarationsList = new List<Instruction>();
_constants = new Dictionary<ConstantKey, Instruction>();
_globals = new List<Instruction>();
_functionsDeclarations = new List<Instruction>();
@@ -126,7 +128,8 @@ namespace Spv.Generator
instruction.SetId(GetNewId());
- _typeDeclarations.Add(key, instruction);
+ _typeDeclarations[key] = instruction;
+ _typeDeclarationsList.Add(instruction);
}
public void AddEntryPoint(ExecutionModel executionModel, Instruction function, string name, params Instruction[] interfaces)
@@ -330,7 +333,7 @@ namespace Spv.Generator
// Ensure that everything is in the right order in the declarations section.
List<Instruction> declarations = new();
- declarations.AddRange(_typeDeclarations.Values);
+ declarations.AddRange(_typeDeclarationsList);
declarations.AddRange(_globals);
declarations.AddRange(_constants.Values);
declarations.Sort((Instruction x, Instruction y) => x.Id.CompareTo(y.Id));