zink: add an early return for zink_descriptors_update_lazy_masked()

no point in generating pools/sets that won't be used here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13350>
This commit is contained in:
Mike Blumenkrantz 2021-10-13 09:32:09 -04:00 committed by Marge Bot
parent 7c840f5103
commit 140d3ea8c6
1 changed files with 20 additions and 19 deletions

View File

@ -463,6 +463,9 @@ zink_descriptors_update_lazy_masked(struct zink_context *ctx, bool is_compute, u
struct zink_batch_descriptor_data_lazy *bdd = bdd_lazy(bs);
struct zink_program *pg = is_compute ? &ctx->curr_compute->base : &ctx->curr_program->base;
VkDescriptorSet desc_sets[ZINK_DESCRIPTOR_TYPES];
if (!pg->dd->binding_usage || (!changed_sets && !bind_sets))
return;
if (!populate_sets(ctx, bdd, pg, &changed_sets, desc_sets)) {
debug_printf("ZINK: couldn't get descriptor sets!\n");
return;
@ -470,31 +473,29 @@ zink_descriptors_update_lazy_masked(struct zink_context *ctx, bool is_compute, u
/* no flushing allowed */
assert(ctx->batch.state == bs);
if (pg->dd->binding_usage && (changed_sets || bind_sets)) {
u_foreach_bit(type, changed_sets) {
assert(type + 1 < pg->num_dsl);
if (pg->dd->layout_key[type]) {
VKSCR(UpdateDescriptorSetWithTemplate)(screen->dev, desc_sets[type], pg->dd->layouts[type + 1]->desc_template, ctx);
VKSCR(CmdBindDescriptorSets)(bs->cmdbuf,
is_compute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS,
/* set index incremented by 1 to account for push set */
pg->layout, type + 1, 1, &desc_sets[type],
0, NULL);
bdd->sets[is_compute][type + 1] = desc_sets[type];
}
}
u_foreach_bit(type, bind_sets & ~changed_sets) {
if (!pg->dd->layout_key[type])
bdd->sets[is_compute][type + 1] = ctx->dd->dummy_set;
assert(bdd->sets[is_compute][type + 1]);
u_foreach_bit(type, changed_sets) {
assert(type + 1 < pg->num_dsl);
if (pg->dd->layout_key[type]) {
VKSCR(UpdateDescriptorSetWithTemplate)(screen->dev, desc_sets[type], pg->dd->layouts[type + 1]->desc_template, ctx);
VKSCR(CmdBindDescriptorSets)(bs->cmdbuf,
is_compute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS,
/* set index incremented by 1 to account for push set */
pg->layout, type + 1, 1, &bdd->sets[is_compute][type + 1],
pg->layout, type + 1, 1, &desc_sets[type],
0, NULL);
bdd->sets[is_compute][type + 1] = desc_sets[type];
}
dd_lazy(ctx)->state_changed[is_compute] = false;
}
u_foreach_bit(type, bind_sets & ~changed_sets) {
if (!pg->dd->layout_key[type])
bdd->sets[is_compute][type + 1] = ctx->dd->dummy_set;
assert(bdd->sets[is_compute][type + 1]);
VKSCR(CmdBindDescriptorSets)(bs->cmdbuf,
is_compute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS,
/* set index incremented by 1 to account for push set */
pg->layout, type + 1, 1, &bdd->sets[is_compute][type + 1],
0, NULL);
}
dd_lazy(ctx)->state_changed[is_compute] = false;
}
void