From e564864b6c945cba6355d9496f2984fe4d23080f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 7 Dec 2021 10:53:57 +0100 Subject: [PATCH] Add check for [EmbeddedBytecode] not having 3 arguments --- .../IShaderGenerator.CreateTryGetBytecodeMethod.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateTryGetBytecodeMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateTryGetBytecodeMethod.cs index 44a5082b..47fc3948 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateTryGetBytecodeMethod.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateTryGetBytecodeMethod.cs @@ -53,7 +53,8 @@ public sealed partial class IShaderGenerator ImmutableArray.Builder builder = ImmutableArray.CreateBuilder(); // Validate the thread number arguments - if (attribute.ConstructorArguments[0].Value is not int threadsX || + if (attribute.ConstructorArguments.Length != 3 || + attribute.ConstructorArguments[0].Value is not int threadsX || attribute.ConstructorArguments[1].Value is not int threadsY || attribute.ConstructorArguments[2].Value is not int threadsZ || threadsX is < 1 or > 1024 ||