From: Mike Blumenkrantz Date: Mon, 24 Oct 2022 20:44:34 +0000 (-0400) Subject: zink: rescope/simplify some push descriptor code X-Git-Tag: upstream/22.3.5~1000 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17f9a3830c6facb619b38cf4550b570d75f24206;p=platform%2Fupstream%2Fmesa.git zink: rescope/simplify some push descriptor code this is only used in the push descriptor block, so move it there and simplify redundant cases Part-of: --- diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index 48bc672..57440ef 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -932,15 +932,6 @@ zink_descriptors_update(struct zink_context *ctx, bool is_compute) } uint8_t changed_sets = pg->dd.binding_usage & ctx->dd.state_changed[is_compute]; - bool need_push = pg->dd.push_usage && - (ctx->dd.push_state_changed[is_compute] || batch_changed); - VkDescriptorSet push_set = VK_NULL_HANDLE; - if (need_push && !have_KHR_push_descriptor) { - struct zink_descriptor_pool *pool = check_push_pool_alloc(ctx, &bs->dd.push_pool[pg->is_compute], bs, pg->is_compute); - push_set = get_descriptor_set(pool); - if (!push_set) - mesa_loge("ZINK: failed to get push descriptor set! prepare to crash!"); - } /* * when binding a pipeline, the pipeline can correctly access any previously bound * descriptor sets which were bound with compatible pipeline layouts @@ -954,13 +945,17 @@ zink_descriptors_update(struct zink_context *ctx, bool is_compute) pg->layout, 0, ctx); } else { if (ctx->dd.push_state_changed[is_compute]) { + struct zink_descriptor_pool *pool = check_push_pool_alloc(ctx, &bs->dd.push_pool[pg->is_compute], bs, pg->is_compute); + VkDescriptorSet push_set = get_descriptor_set(pool); + if (!push_set) + mesa_loge("ZINK: failed to get push descriptor set! prepare to crash!"); VKCTX(UpdateDescriptorSetWithTemplate)(screen->dev, push_set, pg->dd.templates[0], ctx); bs->dd.sets[is_compute][0] = push_set; } - assert(push_set || bs->dd.sets[is_compute][0]); + assert(bs->dd.sets[is_compute][0]); VKCTX(CmdBindDescriptorSets)(bs->cmdbuf, is_compute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS, - pg->layout, 0, 1, push_set ? &push_set : &bs->dd.sets[is_compute][0], + pg->layout, 0, 1, &bs->dd.sets[is_compute][0], 0, NULL); } }