From 4d7294f8e0f945be4ea30402386b67114a42797e Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 17 Nov 2022 11:39:25 -0800 Subject: [PATCH] fix some stackalloc sizes --- src/Graphics/CommandBuffer.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index b63563f..baa2899 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -445,7 +445,7 @@ namespace MoonWorks.Graphics AssertComputeBufferCount(2); #endif - var bufferPtrs = stackalloc IntPtr[1]; + var bufferPtrs = stackalloc IntPtr[2]; bufferPtrs[0] = bufferOne.Handle; bufferPtrs[1] = bufferTwo.Handle; @@ -472,7 +472,7 @@ namespace MoonWorks.Graphics AssertComputeBufferCount(3); #endif - var bufferPtrs = stackalloc IntPtr[1]; + var bufferPtrs = stackalloc IntPtr[3]; bufferPtrs[0] = bufferOne.Handle; bufferPtrs[1] = bufferTwo.Handle; bufferPtrs[2] = bufferThree.Handle; @@ -502,7 +502,7 @@ namespace MoonWorks.Graphics AssertComputeBufferCount(4); #endif - var bufferPtrs = stackalloc IntPtr[1]; + var bufferPtrs = stackalloc IntPtr[4]; bufferPtrs[0] = bufferOne.Handle; bufferPtrs[1] = bufferTwo.Handle; bufferPtrs[2] = bufferThree.Handle; @@ -577,7 +577,7 @@ namespace MoonWorks.Graphics AssertComputeTextureCount(2); #endif - var texturePtrs = stackalloc IntPtr[1]; + var texturePtrs = stackalloc IntPtr[2]; texturePtrs[0] = textureOne.Handle; texturePtrs[1] = textureTwo.Handle; @@ -604,7 +604,7 @@ namespace MoonWorks.Graphics AssertComputeTextureCount(3); #endif - var texturePtrs = stackalloc IntPtr[1]; + var texturePtrs = stackalloc IntPtr[3]; texturePtrs[0] = textureOne.Handle; texturePtrs[1] = textureTwo.Handle; texturePtrs[2] = textureThree.Handle; @@ -634,7 +634,7 @@ namespace MoonWorks.Graphics AssertComputeTextureCount(4); #endif - var texturePtrs = stackalloc IntPtr[1]; + var texturePtrs = stackalloc IntPtr[4]; texturePtrs[0] = textureOne.Handle; texturePtrs[1] = textureTwo.Handle; texturePtrs[2] = textureThree.Handle;