From 1a9f3ba2d7c8314ce39b1d069526c2f542e7571a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sun, 4 Oct 2020 10:55:25 -0400 Subject: [PATCH] zink: only batch-reference the program in use once per descriptor update now that we're guaranteed to know what our batch is earlier, we can move this referencing around to reduce the number of hash lookups we'll perform here Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/gallium/drivers/zink/zink_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_draw.c b/src/gallium/drivers/zink/zink_draw.c index d03fadb9587..9f318903874 100644 --- a/src/gallium/drivers/zink/zink_draw.c +++ b/src/gallium/drivers/zink/zink_draw.c @@ -228,7 +228,6 @@ get_descriptor_set(struct zink_context *ctx, bool is_compute, enum zink_descript { struct zink_program *pg = is_compute ? (struct zink_program *)ctx->curr_compute : (struct zink_program *)ctx->curr_program; struct zink_batch *batch = is_compute ? &ctx->compute_batch : zink_curr_batch(ctx); - zink_batch_reference_program(batch, pg); return zink_program_allocate_desc_set(ctx, batch, pg, type, is_compute, cache_hit); } @@ -351,6 +350,7 @@ update_descriptors(struct zink_context *ctx, struct zink_screen *screen, bool is zds[h] = NULL; } struct zink_batch *batch = is_compute ? &ctx->compute_batch : zink_curr_batch(ctx); + zink_batch_reference_program(batch, pg); struct zink_transition transitions[num_bindings]; int num_transitions = 0;