From: Mike Blumenkrantz Date: Fri, 2 Sep 2022 15:08:46 +0000 (-0400) Subject: zink: simplify bit tracking in zink_gfx_program_update() X-Git-Tag: upstream/22.3.5~2357 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4e9461403ef7b9859570c301a65befdb65ce3e7;p=platform%2Fupstream%2Fmesa.git zink: simplify bit tracking in zink_gfx_program_update() much nicer now that gfx dirty bits are isolated Reviewed-by: Adam Jackson Part-of: --- diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 5218178..391c471 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -559,7 +559,6 @@ zink_gfx_program_update(struct zink_context *ctx) } ctx->last_vertex_stage_dirty = false; } - unsigned bits = BITFIELD_MASK(MESA_SHADER_COMPUTE); if (ctx->gfx_dirty) { struct zink_gfx_program *prog = NULL; @@ -590,7 +589,7 @@ zink_gfx_program_update(struct zink_context *ctx) update_gfx_program(ctx, prog); } } else { - ctx->dirty_gfx_stages |= bits; + ctx->dirty_gfx_stages |= ctx->shader_stages; prog = zink_create_gfx_program(ctx, ctx->gfx_stages, ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch); _mesa_hash_table_insert_pre_hashed(ht, hash, prog->shaders, prog); if (screen->optimal_keys) @@ -606,7 +605,7 @@ zink_gfx_program_update(struct zink_context *ctx) ctx->curr_program = prog; ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; ctx->gfx_dirty = false; - } else if (ctx->dirty_gfx_stages & bits) { + } else if (ctx->dirty_gfx_stages) { /* remove old hash */ ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; if (screen->optimal_keys) { @@ -620,7 +619,7 @@ zink_gfx_program_update(struct zink_context *ctx) /* apply new hash */ ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; } - ctx->dirty_gfx_stages &= ~bits; + ctx->dirty_gfx_stages = 0; } static void