From 6a34a86aa58854e1b23c7ac2abf94b482a6223a3 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 17 Aug 2019 10:06:36 +0200 Subject: [PATCH] Fixed initialization of XYZ variables --- src/ComputeSharp.Shaders/ShaderRunner.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ComputeSharp.Shaders/ShaderRunner.cs b/src/ComputeSharp.Shaders/ShaderRunner.cs index 6caf6aa7..d5063917 100644 --- a/src/ComputeSharp.Shaders/ShaderRunner.cs +++ b/src/ComputeSharp.Shaders/ShaderRunner.cs @@ -104,8 +104,7 @@ namespace ComputeSharp.Shaders } // Initialize the loop targets - Span xyzSpan = stackalloc uint[] { (uint)x, (uint)y, (uint)z }; - ConstantBuffer xyzBuffer = device.AllocateConstantBuffer(xyzSpan); + var xyzBuffer = device.AllocateConstantBufferFromReflectedValues(new object[] { (uint)x, (uint)y, (uint)z }); commandList.SetComputeRootDescriptorTable(shaderLoader.RootParameters.Length - 1, xyzBuffer); buffers.Add(xyzBuffer);