From bed612a848b19b685bc2a27ccb37a362e1537418 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 27 Jan 2022 21:12:44 -0800 Subject: [PATCH] fix case where no workgroups are dispatched --- src/SpriteBatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SpriteBatch.cs b/src/SpriteBatch.cs index 6d82a0c..4cf983e 100644 --- a/src/SpriteBatch.cs +++ b/src/SpriteBatch.cs @@ -148,7 +148,7 @@ namespace MoonWorksComputeSpriteBatch { VertexCount = VertexCount }); - commandBuffer.DispatchCompute(VertexCount / 256, 1, 1, offset); + commandBuffer.DispatchCompute(System.Math.Max(1, VertexCount / 256), 1, 1, offset); commandBuffer.BeginRenderPass(renderPass, framebuffer, renderArea, Vector4.Zero); commandBuffer.BindGraphicsPipeline(graphicsPipeline);