diff options
author | Jerome Glisse <jglisse@redhat.com> | 2010-12-05 19:24:03 -0500 |
---|---|---|
committer | Jerome Glisse <jglisse@redhat.com> | 2010-12-06 15:50:50 -0500 |
commit | afc56b1861c1dae4137493af4c0e6dacc6ee41f9 (patch) | |
tree | 78fa76b483f07d5aecc11be145703533e9e2ecc5 /src/gallium/drivers/r600/r600_state_common.c | |
parent | fa86fc564aea4e40c89f6fc889e6a5bf817634b3 (diff) |
r600g: avoid useless shader rebuild at draw call
Avoid rebuilding constant shader state at each draw call,
factor out spi update that might change at each draw call.
Best would be to update spi only when revealent states
change (likely only flat shading & sprite point).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state_common.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 889432732c..c647e77b37 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -269,6 +269,9 @@ void r600_bind_ps_shader(struct pipe_context *ctx, void *state) /* TODO delete old shader */ rctx->ps_shader = (struct r600_pipe_shader *)state; + if (state) { + r600_context_pipe_state_set(&rctx->ctx, &rctx->ps_shader->rstate); + } } void r600_bind_vs_shader(struct pipe_context *ctx, void *state) @@ -277,6 +280,9 @@ void r600_bind_vs_shader(struct pipe_context *ctx, void *state) /* TODO delete old shader */ rctx->vs_shader = (struct r600_pipe_shader *)state; + if (state) { + r600_context_pipe_state_set(&rctx->ctx, &rctx->vs_shader->rstate); + } } void r600_delete_ps_shader(struct pipe_context *ctx, void *state) |