From c2ef78d136e1ef1d39e15f7da722df1f7496e230 Mon Sep 17 00:00:00 2001 From: TheSpydog Date: Mon, 14 Nov 2022 18:21:03 +0000 Subject: [PATCH] Add validation check that all work group dimension counts are >= 1 (#34) Co-authored-by: Caleb Cornett Reviewed-on: https://gitea.moonside.games/MoonsideGames/MoonWorks/pulls/34 Co-authored-by: TheSpydog Co-committed-by: TheSpydog --- src/Graphics/CommandBuffer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index 923e766..7782c2c 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -211,6 +211,11 @@ namespace MoonWorks.Graphics { #if DEBUG AssertComputePipelineBound(); + + if (groupCountX < 1 || groupCountY < 1 || groupCountZ < 1) + { + throw new ArgumentException("All dimensions for the compute work group must be >= 1!"); + } #endif Refresh.Refresh_DispatchCompute(