Module: Mesa Branch: main Commit: 87f4252a51ff2e6227dceea12f608366cb98e141 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=87f4252a51ff2e6227dceea12f608366cb98e141
Author: Dave Airlie <[email protected]> Date: Mon May 9 15:51:45 2022 +1000 zink: don't finish barriers cmd buffer if not used. finishing has some cpu overhead, which if the cmd buffer isn't going to be used is pointless. just let it get reset next time. Reviewed-by: Mike Blumenkrantz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16393> --- src/gallium/drivers/zink/zink_batch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index fb85cf3e343..47b2f20293d 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -403,10 +403,12 @@ submit_queue(void *data, void *gdata, int thread_index) bs->is_device_lost = true; goto end; } - if (VKSCR(EndCommandBuffer)(bs->barrier_cmdbuf) != VK_SUCCESS) { - mesa_loge("ZINK: vkEndCommandBuffer failed"); - bs->is_device_lost = true; - goto end; + if (bs->has_barriers) { + if (VKSCR(EndCommandBuffer)(bs->barrier_cmdbuf) != VK_SUCCESS) { + mesa_loge("ZINK: vkEndCommandBuffer failed"); + bs->is_device_lost = true; + goto end; + } } while (util_dynarray_contains(&bs->persistent_resources, struct zink_resource_object*)) {
