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>
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;
if (rctx->vs_shader == sel)
return;
- rctx->shader_dirty = true;
rctx->vs_shader = sel;
if (sel && sel->current)
if (rctx->ps_shader == sel)
return;
- rctx->shader_dirty = true;
rctx->ps_shader = sel;
if (sel && sel->current)
#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); \
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;
}
}