diff options
author | Tom Stellard <[email protected]> | 2012-06-06 19:44:09 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-06-21 20:42:07 +0000 |
commit | ff08f1ec6fa50cdcebfa825505fd93dd1edd1832 (patch) | |
tree | 19df408ee10f91c33c89759799958c3d6f144d79 /src | |
parent | 5cd6ce939d1158d0ee3dd376e2c95aeff49c6e27 (diff) |
r600g: Enable reusing of compute state
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_compute.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index 3bb3895bf73..b2af26d8255 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -147,18 +147,21 @@ static void evergreen_bind_compute_state(struct pipe_context *ctx_, void *state) ctx->cs_shader = (struct r600_pipe_compute *)state; - assert(!ctx->cs_shader->shader_code_bo); + if (!ctx->cs_shader->shader_code_bo) { - ctx->cs_shader->shader_code_bo = - r600_compute_buffer_alloc_vram(ctx->screen, + ctx->cs_shader->shader_code_bo = + r600_compute_buffer_alloc_vram(ctx->screen, ctx->cs_shader->bc.ndw * 4); - void *p = ctx->ws->buffer_map(ctx->cs_shader->shader_code_bo->cs_buf, + void *p = ctx->ws->buffer_map( + ctx->cs_shader->shader_code_bo->cs_buf, ctx->cs, PIPE_TRANSFER_WRITE); - memcpy(p, ctx->cs_shader->bc.bytecode, ctx->cs_shader->bc.ndw * 4); + memcpy(p, ctx->cs_shader->bc.bytecode, ctx->cs_shader->bc.ndw * 4); - ctx->ws->buffer_unmap(ctx->cs_shader->shader_code_bo->cs_buf); + ctx->ws->buffer_unmap(ctx->cs_shader->shader_code_bo->cs_buf); + + } evergreen_compute_init_config(ctx); |