aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/evergreen_compute.c
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-06-07 15:22:47 -0400
committerTom Stellard <[email protected]>2012-06-21 20:42:07 +0000
commitff2b417245e8e62b546e27771e36460acc666a8e (patch)
treea1b191be2eafb928a0399c2ac005f5acb98db2a0 /src/gallium/drivers/r600/evergreen_compute.c
parentff08f1ec6fa50cdcebfa825505fd93dd1edd1832 (diff)
r600g: Unify SURFACE_SYNC packet emission for 3D and compute
Drop the compute specific evergreen_set_buffer_sync() function and instead use the r600_surface_sync_command atom for emitting SURFACE_SYNC packets.
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_compute.c')
-rw-r--r--src/gallium/drivers/r600/evergreen_compute.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index b2af26d8255..4389021dab7 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -187,7 +187,8 @@ static void evergreen_bind_compute_state(struct pipe_context *ctx_, void *state)
res->bo = ctx->cs_shader->shader_code_bo;
res->usage = RADEON_USAGE_READ;
res->coher_bo_size = ctx->cs_shader->bc.ndw*4;
- res->flags = COMPUTE_RES_SH_FLUSH;
+
+ r600_inval_shader_cache(ctx);
/* We can't always determine the
* number of iterations in a loop before it's executed,
@@ -363,15 +364,20 @@ static void compute_emit_cs(struct r600_context *ctx)
ctx->cs_shader->resources[i].bo,
ctx->cs_shader->resources[i].usage);
}
-
- evergreen_set_buffer_sync(ctx, ctx->cs_shader->resources[i].bo,
- ctx->cs_shader->resources[i].coher_bo_size,
- ctx->cs_shader->resources[i].flags,
- ctx->cs_shader->resources[i].usage);
}
}
}
+ /* r600_flush_framebuffer() updates the cb_flush_flags and then
+ * calls r600_emit_atom() on the ctx->surface_sync_cmd.atom, which emits
+ * a SURFACE_SYNC packet via r600_emit_surface_sync().
+ *
+ * XXX r600_emit_surface_sync() hardcodes the CP_COHER_SIZE to
+ * 0xffffffff, so we will need to add a field to struct
+ * r600_surface_sync_cmd if we want to manually set this value.
+ */
+ r600_flush_framebuffer(ctx, true /* Flush now */);
+
#if 0
COMPUTE_DBG("cdw: %i\n", cs->cdw);
for (i = 0; i < cs->cdw; i++) {