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 <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
This commit is contained in:
Mike Blumenkrantz 2020-10-04 10:55:25 -04:00 committed by Marge Bot
parent 9df3147264
commit 1a9f3ba2d7
1 changed files with 1 additions and 1 deletions

View File

@ -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;