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 <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16393>
This commit is contained in:
Dave Airlie 2022-05-09 15:51:45 +10:00 committed by Marge Bot
parent 57df27be5f
commit 87f4252a51

View file

@ -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*)) {