diff --git a/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateGetInputTypeMethod.cs b/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateGetInputTypeMethod.cs index 53bc8909..e9904031 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateGetInputTypeMethod.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateGetInputTypeMethod.cs @@ -99,6 +99,9 @@ partial class ID2D1ShaderGenerator Span selectedSimpleInputIndices = stackalloc bool[8]; Span selectedComplexInputIndices = stackalloc bool[8]; + selectedSimpleInputIndices.Clear(); + selectedComplexInputIndices.Clear(); + // All simple indices must be unique foreach (int index in inputSimpleIndicesBuilder.WrittenSpan) { diff --git a/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadInputDescriptionsMethod.cs b/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadInputDescriptionsMethod.cs index c8dd433f..7813b71e 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadInputDescriptionsMethod.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadInputDescriptionsMethod.cs @@ -76,6 +76,8 @@ partial class ID2D1ShaderGenerator Span selectedInputDescriptionIndices = stackalloc bool[8]; + selectedInputDescriptionIndices.Clear(); + // All input description indices must be unique foreach (InputDescription inputDescription in inputDescriptionsBuilder.WrittenSpan) { diff --git a/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadResourceTextureDescriptionsMethod.cs b/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadResourceTextureDescriptionsMethod.cs index 0c788c2f..f1bf3151 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadResourceTextureDescriptionsMethod.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/ID2D1ShaderGenerator.CreateLoadResourceTextureDescriptionsMethod.cs @@ -115,6 +115,8 @@ partial class ID2D1ShaderGenerator Span selectedResourceTextureIndices = stackalloc bool[16]; + selectedResourceTextureIndices.Clear(); + // All input description indices must be unique (also take this path for invalid indices) foreach ((int? index, _) in resourceTextureInfos.WrittenSpan) {