From 291ac872a445f3edebd668b27e910a79e1de5a00 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 3 May 2016 16:54:21 -0400 Subject: freedreno: move shader-stage dirty bits to global dirty flag This was always a bit overly complicated, and had some issues (like ctx->prog.dirty not getting reset at the end of the batch). It also required some special hacks to avoid resetting dirty state on binning pass. So just move it all into ctx->dirty (leaving some free bits for future shader stages), and make FD_DIRTY_PROG just be the union of all FD_SHADER_DIRTY_*. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/a4xx/fd4_draw.c | 16 +++++++--------- src/gallium/drivers/freedreno/a4xx/fd4_emit.c | 5 ----- 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'src/gallium/drivers/freedreno/a4xx') diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_draw.c b/src/gallium/drivers/freedreno/a4xx/fd4_draw.c index d49c529aab4..af02d31fb91 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_draw.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_draw.c @@ -88,36 +88,34 @@ fixup_shader_state(struct fd_context *ctx, struct ir3_shader_key *key) struct ir3_shader_key *last_key = &fd4_ctx->last_key; if (!ir3_shader_key_equal(last_key, key)) { - ctx->dirty |= FD_DIRTY_PROG; - if (last_key->has_per_samp || key->has_per_samp) { if ((last_key->vsaturate_s != key->vsaturate_s) || (last_key->vsaturate_t != key->vsaturate_t) || (last_key->vsaturate_r != key->vsaturate_r) || (last_key->vastc_srgb != key->vastc_srgb)) - ctx->prog.dirty |= FD_SHADER_DIRTY_VP; + ctx->dirty |= FD_SHADER_DIRTY_VP; if ((last_key->fsaturate_s != key->fsaturate_s) || (last_key->fsaturate_t != key->fsaturate_t) || (last_key->fsaturate_r != key->fsaturate_r) || (last_key->fastc_srgb != key->fastc_srgb)) - ctx->prog.dirty |= FD_SHADER_DIRTY_FP; + ctx->dirty |= FD_SHADER_DIRTY_FP; } if (last_key->vclamp_color != key->vclamp_color) - ctx->prog.dirty |= FD_SHADER_DIRTY_VP; + ctx->dirty |= FD_SHADER_DIRTY_VP; if (last_key->fclamp_color != key->fclamp_color) - ctx->prog.dirty |= FD_SHADER_DIRTY_FP; + ctx->dirty |= FD_SHADER_DIRTY_FP; if (last_key->color_two_side != key->color_two_side) - ctx->prog.dirty |= FD_SHADER_DIRTY_FP; + ctx->dirty |= FD_SHADER_DIRTY_FP; if (last_key->half_precision != key->half_precision) - ctx->prog.dirty |= FD_SHADER_DIRTY_FP; + ctx->dirty |= FD_SHADER_DIRTY_FP; if (last_key->rasterflat != key->rasterflat) - ctx->prog.dirty |= FD_SHADER_DIRTY_FP; + ctx->dirty |= FD_SHADER_DIRTY_FP; fd4_ctx->last_key = *key; } diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c index 459494c0903..00e985d27e5 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c @@ -649,11 +649,6 @@ fd4_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring, ir3_emit_consts(vp, ring, ctx, emit->info, dirty); if (!emit->key.binning_pass) ir3_emit_consts(fp, ring, ctx, emit->info, dirty); - /* mark clean after emitting consts.. a bit ugly, but since binning - * pass is emitted first, we want to do this only for main draw: - */ - if (!emit->key.binning_pass) - ctx->prog.dirty = 0; } if ((dirty & FD_DIRTY_BLEND)) { -- cgit v1.2.3