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);