zink: track a mask of gfx stages remaining in gfx programs

this provides a hint to improve program deletion

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
This commit is contained in:
Mike Blumenkrantz
2022-09-19 18:14:06 -04:00
committed by Marge Bot
parent 0f770caa23
commit 2fa7091263
3 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -3253,8 +3253,10 @@ zink_shader_free(struct zink_context *ctx, struct zink_shader *shader)
_mesa_hash_table_remove(ht, he);
prog->base.removed = true;
}
if (stage != MESA_SHADER_TESS_CTRL || !shader->is_generated)
if (stage != MESA_SHADER_TESS_CTRL || !shader->is_generated) {
prog->shaders[stage] = NULL;
prog->stages_remaining &= ~BITFIELD_BIT(stage);
}
/* only remove generated tcs during parent tes destruction */
if (stage == MESA_SHADER_TESS_EVAL && shader->generated)
prog->shaders[MESA_SHADER_TESS_CTRL] = NULL;
+1
View File
@@ -640,6 +640,7 @@ zink_create_gfx_program(struct zink_context *ctx,
zink_shader_tcs_create(screen, stages[MESA_SHADER_VERTEX], vertices_per_patch);
prog->stages_present |= BITFIELD_BIT(MESA_SHADER_TESS_CTRL);
}
prog->stages_remaining = prog->stages_present;
assign_io(prog, prog->shaders);
+1
View File
@@ -798,6 +798,7 @@ struct zink_gfx_program {
struct zink_program base;
uint32_t stages_present; //mask of stages present in this program
uint32_t stages_remaining; //mask of zink_shader remaining in this program
struct nir_shader *nir[ZINK_GFX_SHADER_COUNT];
struct zink_shader_module *modules[ZINK_GFX_SHADER_COUNT]; // compute stage doesn't belong here