From e9475b13137db2cca8571576b5381a70fb8180a5 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 2 Apr 2023 00:27:50 +0100 Subject: [PATCH] c/main: Use cmd helpers for main submission --- src/xrt/compositor/main/comp_renderer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c index 68af19152..f028250c0 100644 --- a/src/xrt/compositor/main/comp_renderer.c +++ b/src/xrt/compositor/main/comp_renderer.c @@ -35,6 +35,7 @@ #endif #include "vk/vk_helpers.h" +#include "vk/vk_cmd.h" #include "vk/vk_image_readback_to_xf_pool.h" #include "vk/vk_cmd.h" @@ -696,7 +697,13 @@ renderer_submit_queue(struct comp_renderer *r, VkCommandBuffer cmd, VkPipelineSt .pSignalSemaphores = &ct->semaphores.render_complete, }; - ret = vk_locked_submit(vk, vk->queue, 1, &comp_submit_info, r->fences[r->acquired_buffer]); + /* + * The renderer command buffer pool is only accessed from one thread, + * this satisfies the `_locked` requirement of the function. This lets + * us avoid taking a lot of locks. The queue lock will be taken by + * @ref vk_cmd_submit_locked tho. + */ + ret = vk_cmd_submit_locked(vk, 1, &comp_submit_info, r->fences[r->acquired_buffer]); if (ret != VK_SUCCESS) { COMP_ERROR(r->c, "vkQueueSubmit: %s", vk_result_string(ret)); }