From fdcaa8906d48e37be2529cb1b068207df842788e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 16 Sep 2019 03:36:09 +0200 Subject: [PATCH] Fixed IL errors --- .../Translation/ShaderHashCodeProvider.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.Shaders/Translation/ShaderHashCodeProvider.cs b/src/ComputeSharp.Shaders/Translation/ShaderHashCodeProvider.cs index f913da95..c429b779 100644 --- a/src/ComputeSharp.Shaders/Translation/ShaderHashCodeProvider.cs +++ b/src/ComputeSharp.Shaders/Translation/ShaderHashCodeProvider.cs @@ -70,8 +70,11 @@ namespace ComputeSharp.Shaders.Translation DynamicMethod method = new DynamicMethod("GetHashCodeForHlslDelegates", typeof(int), new[] { typeof(int), typeof(object) }, declaringType); ILGenerator il = method.GetILGenerator(); + // Declare the local variable to store the target instance + il.DeclareLocal(declaringType); + // Load the argument (the object instance) - il.Emit(OpCodes.Ldarg_0); + il.Emit(OpCodes.Ldarg_1); il.Emit(OpCodes.Castclass, declaringType); il.Emit(OpCodes.Stloc_0);