radeonsi: start reworking inferred state handling

Instead of tracking the inferred state changes separately
just check if queued and emitted states are the same.

This patch just reworks the update of the SPI map between
vs and ps, but there are probably more cases like this.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Christian König
2012-09-14 17:05:34 +02:00
parent 112caa853d
commit 04473db38a
4 changed files with 4 additions and 6 deletions

View File

@@ -140,7 +140,6 @@ struct r600_context {
struct r600_textures_info ps_samplers;
struct si_resource *border_color_table;
unsigned border_color_offset;
boolean shader_dirty;
struct u_upload_mgr *uploader;
struct util_slab_mempool pool_transfers;

View File

@@ -1969,7 +1969,6 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
if (rctx->vs_shader == sel)
return;
rctx->shader_dirty = true;
rctx->vs_shader = sel;
if (sel && sel->current)
@@ -1986,7 +1985,6 @@ static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
if (rctx->ps_shader == sel)
return;
rctx->shader_dirty = true;
rctx->ps_shader = sel;
if (sel && sel->current)

View File

@@ -101,6 +101,9 @@ union si_state {
#define si_pm4_block_idx(member) \
(offsetof(union si_state, named.member) / sizeof(struct si_pm4_state *))
#define si_pm4_state_changed(rctx, member) \
((rctx)->queued.named.member != (rctx)->emitted.named.member)
#define si_pm4_bind_state(rctx, member, value) \
do { \
(rctx)->queued.named.member = (value); \

View File

@@ -406,12 +406,10 @@ static void si_update_derived_state(struct r600_context *rctx)
if (ps_dirty) {
si_pm4_bind_state(rctx, ps, rctx->ps_shader->current->pm4);
rctx->shader_dirty = true;
}
if (rctx->shader_dirty) {
if (si_pm4_state_changed(rctx, ps) || si_pm4_state_changed(rctx, vs)) {
si_update_spi_map(rctx);
rctx->shader_dirty = false;
}
}