#include "glheader.h"
#include "compute.h"
#include "context.h"
+#include "api_validate.h"
void GLAPIENTRY
_mesa_DispatchCompute(GLuint num_groups_x,
GLuint num_groups_z)
{
GET_CURRENT_CONTEXT(ctx);
+ const GLuint num_groups[3] = { num_groups_x, num_groups_y, num_groups_z };
- if (ctx->Extensions.ARB_compute_shader) {
- assert(!"TODO");
- } else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "unsupported function (glDispatchCompute) called");
- }
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glDispatchCompute(%d, %d, %d)\n",
+ num_groups_x, num_groups_y, num_groups_z);
+
+ if (!_mesa_validate_DispatchCompute(ctx, num_groups))
+ return;
+
+ if (num_groups_x == 0u || num_groups_y == 0u || num_groups_z == 0u)
+ return;
+
+ ctx->Driver.DispatchCompute(ctx, num_groups);
}
extern void GLAPIENTRY
{
GET_CURRENT_CONTEXT(ctx);
- if (ctx->Extensions.ARB_compute_shader) {
- assert(!"TODO");
- } else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "unsupported function (glDispatchComputeIndirect) called");
- }
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glDispatchComputeIndirect(%ld)\n", (long) indirect);
+
+ if (!_mesa_validate_DispatchComputeIndirect(ctx, indirect))
+ return;
+
+ ctx->Driver.DispatchComputeIndirect(ctx, indirect);
}