summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/compute.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-05-15 11:22:25 +1000
committerTimothy Arceri <[email protected]>2017-05-17 10:12:04 +1000
commit07e14d561c7ab9ed379f33cfad56a578752ee2f9 (patch)
treef441074809914cb86421d3e957f7788a6161aaf2 /src/mesa/main/compute.c
parentf98411eaad760ff5f02c8e332663635ac932fd39 (diff)
mesa: move FLUSH_CURRENT() calls out of DispatchCompute*() validation
This is required to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/compute.c')
-rw-r--r--src/mesa/main/compute.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/compute.c b/src/mesa/main/compute.c
index e881d4f5a39..f3cc6afd406 100644
--- a/src/mesa/main/compute.c
+++ b/src/mesa/main/compute.c
@@ -54,8 +54,6 @@ check_valid_to_compute(struct gl_context *ctx, const char *function)
static bool
validate_DispatchCompute(struct gl_context *ctx, const GLuint *num_groups)
{
- FLUSH_CURRENT(ctx, 0);
-
if (!check_valid_to_compute(ctx, "glDispatchCompute"))
return GL_FALSE;
@@ -107,8 +105,6 @@ validate_DispatchComputeGroupSizeARB(struct gl_context *ctx,
{
GLuint total_invocations = 1;
- FLUSH_CURRENT(ctx, 0);
-
if (!check_valid_to_compute(ctx, "glDispatchComputeGroupSizeARB"))
return GL_FALSE;
@@ -184,8 +180,6 @@ validate_DispatchComputeGroupSizeARB(struct gl_context *ctx,
static bool
valid_dispatch_indirect(struct gl_context *ctx, GLintptr indirect)
{
- FLUSH_CURRENT(ctx, 0);
-
GLsizei size = 3 * sizeof(GLuint);
const uint64_t end = (uint64_t) indirect + size;
const char *name = "glDispatchComputeIndirect";
@@ -257,6 +251,8 @@ _mesa_DispatchCompute(GLuint num_groups_x,
GET_CURRENT_CONTEXT(ctx);
const GLuint num_groups[3] = { num_groups_x, num_groups_y, num_groups_z };
+ FLUSH_CURRENT(ctx, 0);
+
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glDispatchCompute(%d, %d, %d)\n",
num_groups_x, num_groups_y, num_groups_z);
@@ -275,6 +271,8 @@ _mesa_DispatchComputeIndirect(GLintptr indirect)
{
GET_CURRENT_CONTEXT(ctx);
+ FLUSH_CURRENT(ctx, 0);
+
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glDispatchComputeIndirect(%ld)\n", (long) indirect);
@@ -293,6 +291,8 @@ _mesa_DispatchComputeGroupSizeARB(GLuint num_groups_x, GLuint num_groups_y,
const GLuint num_groups[3] = { num_groups_x, num_groups_y, num_groups_z };
const GLuint group_size[3] = { group_size_x, group_size_y, group_size_z };
+ FLUSH_CURRENT(ctx, 0);
+
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx,
"glDispatchComputeGroupSizeARB(%d, %d, %d, %d, %d, %d)\n",