From 44d73f0fa67b66fdd91ff9dce4aaa876bbf2e116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 13 Oct 2023 19:15:05 +0200 Subject: [PATCH] GL: Silence null dispatch error These are false positive. We actually want to not dispatch in this case. --- source/blender/gpu/opengl/gl_compute.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/gpu/opengl/gl_compute.cc b/source/blender/gpu/opengl/gl_compute.cc index e3694b0c486..5d6e9d40c02 100644 --- a/source/blender/gpu/opengl/gl_compute.cc +++ b/source/blender/gpu/opengl/gl_compute.cc @@ -16,6 +16,12 @@ void GLCompute::dispatch(int group_x_len, int group_y_len, int group_z_len) { GL_CHECK_RESOURCES("Compute"); + /* Sometime we reference a dispatch size but we want to skip it by setting one dimension to 0. + * Avoid error being reported on some implementation for these case. */ + if (group_x_len == 0 || group_y_len == 0 || group_z_len == 0) { + return; + } + glDispatchCompute(group_x_len, group_y_len, group_z_len); }