summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2010-09-22 14:00:53 -0400
committerJerome Glisse <[email protected]>2010-09-22 14:19:05 -0400
commitb8835a3992edb7b01712ea83b5729ef0f6f94e4f (patch)
tree099d1f11b344690d1d570597a97a0c2daa310696 /src/gallium/drivers/r600
parent516ac2bd50ad1e71bd2a359d247532d9f18bcf99 (diff)
r600g: disable shader rebuild optimization & account cb flush packet
Shader rebuild should be more clever, we should store along each shader all the value that change shader program rather than using flags in context (ie change sequence like : change vs buffer, draw, change vs buffer, switch shader will trigger useless shader rebuild). Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/r600_state2.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/gallium/drivers/r600/r600_state2.c b/src/gallium/drivers/r600/r600_state2.c
index b93bdd3022b..4ad9e4c6eb1 100644
--- a/src/gallium/drivers/r600/r600_state2.c
+++ b/src/gallium/drivers/r600/r600_state2.c
@@ -137,8 +137,6 @@ struct r600_pipe_context {
struct r600_pipe_shader *ps_shader;
struct r600_pipe_shader *vs_shader;
/* shader information */
- bool ps_rebuild;
- bool vs_rebuild;
unsigned sprite_coord_enable;
bool flatshade;
};
@@ -198,7 +196,6 @@ static void r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shade
r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT,
R_028894_SQ_PGM_START_FS,
0x00000000, 0xFFFFFFFF, shader->bo);
- rctx->vs_rebuild = FALSE;
}
static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader)
@@ -268,7 +265,6 @@ static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shade
r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT,
R_0288CC_SQ_PGM_CF_OFFSET_PS,
0x00000000, 0xFFFFFFFF, NULL);
- rctx->ps_rebuild = FALSE;
}
static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *shader)
@@ -350,20 +346,6 @@ static int r600_pipe_shader_update2(struct pipe_context *ctx, struct r600_pipe_s
if (shader == NULL)
return -EINVAL;
- if (shader->bo) {
- switch (shader->shader.processor_type) {
- case TGSI_PROCESSOR_VERTEX:
- if (!rctx->vs_rebuild)
- return 0;
- break;
- case TGSI_PROCESSOR_FRAGMENT:
- if (!rctx->ps_rebuild)
- return 0;
- break;
- default:
- return -EINVAL;
- }
- }
/* there should be enough input */
if (rctx->vertex_elements->count < shader->shader.bc.nresource) {
R600_ERR("%d resources provided, expecting %d\n",
@@ -644,6 +626,7 @@ static void r600_draw_common(struct r600_drawl *draw)
if (draw->index_buffer) {
rbuffer = (struct r600_resource*)draw->index_buffer;
rdraw.indices = rbuffer->bo;
+ rdraw.indices_bo_offset = 0;
}
r600_context_draw(&rctx->ctx, &rdraw);
}
@@ -1075,10 +1058,10 @@ static void r600_bind_rs_state(struct pipe_context *ctx, void *state)
return;
if (rctx->flatshade != rs->flatshade) {
- rctx->ps_rebuild = TRUE;
+// rctx->ps_rebuild = TRUE;
}
if (rctx->sprite_coord_enable != rs->sprite_coord_enable) {
- rctx->ps_rebuild = TRUE;
+// rctx->ps_rebuild = TRUE;
}
rctx->flatshade = rs->flatshade;
rctx->sprite_coord_enable = rs->sprite_coord_enable;
@@ -1364,7 +1347,7 @@ static void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
rctx->vertex_elements = v;
if (v) {
v->refcount++;
- rctx->vs_rebuild = TRUE;
+// rctx->vs_rebuild = TRUE;
}
}