summaryrefslogtreecommitdiffstats
path: root/drivers/vulkan/rendering_device_vulkan.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-10-31 09:12:10 +0100
committerGitHub <noreply@github.com>2021-10-31 09:12:10 +0100
commitd6f972fad45d28222b1437a047241dd74f0d5b90 (patch)
treef464390199e97e5e73d91d3cbb76880a4264a429 /drivers/vulkan/rendering_device_vulkan.cpp
parent2074647ab9891e9f94108e72ee7b3a7b70e8cd8c (diff)
parent346e4979599107420d964e5a573621c413a83422 (diff)
downloadredot-engine-d6f972fad45d28222b1437a047241dd74f0d5b90.tar.gz
Merge pull request #54403 from briansemrau/fix-small-fogvolume
FogVolume don't dispatch compute with zero-dimension groups
Diffstat (limited to 'drivers/vulkan/rendering_device_vulkan.cpp')
-rw-r--r--drivers/vulkan/rendering_device_vulkan.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp
index ed7cc7bf2c..4cae051302 100644
--- a/drivers/vulkan/rendering_device_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_vulkan.cpp
@@ -8049,6 +8049,9 @@ void RenderingDeviceVulkan::compute_list_dispatch(ComputeListID p_list, uint32_t
ComputeList *cl = compute_list;
#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND_MSG(p_x_groups == 0, "Dispatch amount of X compute groups (" + itos(p_x_groups) + ") is zero.");
+ ERR_FAIL_COND_MSG(p_z_groups == 0, "Dispatch amount of Z compute groups (" + itos(p_z_groups) + ") is zero.");
+ ERR_FAIL_COND_MSG(p_y_groups == 0, "Dispatch amount of Y compute groups (" + itos(p_y_groups) + ") is zero.");
ERR_FAIL_COND_MSG(p_x_groups > limits.maxComputeWorkGroupCount[0],
"Dispatch amount of X compute groups (" + itos(p_x_groups) + ") is larger than device limit (" + itos(limits.maxComputeWorkGroupCount[0]) + ")");
ERR_FAIL_COND_MSG(p_y_groups > limits.maxComputeWorkGroupCount[1],
@@ -8103,6 +8106,12 @@ void RenderingDeviceVulkan::compute_list_dispatch_threads(ComputeListID p_list,
ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST);
ERR_FAIL_COND(!compute_list);
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND_MSG(p_x_threads == 0, "Dispatch amount of X compute threads (" + itos(p_x_threads) + ") is zero.");
+ ERR_FAIL_COND_MSG(p_y_threads == 0, "Dispatch amount of Y compute threads (" + itos(p_y_threads) + ") is zero.");
+ ERR_FAIL_COND_MSG(p_z_threads == 0, "Dispatch amount of Z compute threads (" + itos(p_z_threads) + ") is zero.");
+#endif
+
ComputeList *cl = compute_list;
#ifdef DEBUG_ENABLED