2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2021-05-26 16:49:17 +02:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup gpu
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "gl_compute.hh"
|
|
|
|
|
|
|
|
|
|
#include "gl_debug.hh"
|
|
|
|
|
|
|
|
|
|
namespace blender::gpu {
|
|
|
|
|
|
|
|
|
|
void GLCompute::dispatch(int group_x_len, int group_y_len, int group_z_len)
|
|
|
|
|
{
|
2022-02-06 17:01:10 +01:00
|
|
|
GL_CHECK_RESOURCES("Compute");
|
2022-02-15 00:10:50 +01:00
|
|
|
|
2023-10-13 19:15:05 +02:00
|
|
|
/* 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;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-26 16:49:17 +02:00
|
|
|
glDispatchCompute(group_x_len, group_y_len, group_z_len);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace blender::gpu
|