···3131 */
3232struct vk_cmd_pool
3333{
3434+ //! The command pool for command buffers
3435 VkCommandPool pool;
3636+3737+ /*!
3838+ * @brief Queue (family) associated with @ref vk_cmd_pool::pool,
3939+ *
4040+ * weak reference to any queue in @ref vk_bundle (e.g. vk_bundle::[graphics|compute]_queue)
4141+ * should not live longer than the @ref vk_bundle instance.
4242+ */
4343+ struct vk_bundle_queue *queue;
4444+4545+ //! Command Pool mutex
3546 struct os_mutex mutex;
3647};
3748···4859 * @public @memberof vk_cmd_pool
4960 */
5061XRT_CHECK_RESULT VkResult
5151-vk_cmd_pool_init(struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandPoolCreateFlags flags);
6262+vk_cmd_pool_init_for_queue(struct vk_bundle *vk,
6363+ struct vk_cmd_pool *pool,
6464+ VkCommandPoolCreateFlags flags,
6565+ struct vk_bundle_queue *queue);
6666+6767+/*!
6868+ * Create a command buffer pool.
6969+ *
7070+ * @public @memberof vk_cmd_pool
7171+ */
7272+static inline XRT_CHECK_RESULT VkResult
7373+vk_cmd_pool_init(struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandPoolCreateFlags flags)
7474+{
7575+ return vk_cmd_pool_init_for_queue(vk, pool, flags, &vk->main_queue);
7676+}
52775378/*!
5479 * Destroy a command buffer pool, lock must not be held, externally
···113138 struct vk_cmd_pool *pool,
114139 VkCommandBuffer cmd_buffer)
115140{
116116- return vk_cmd_end_submit_wait_and_free_cmd_buffer_locked(vk, pool->pool, cmd_buffer);
141141+ return vk_cmd_end_submit_wait_and_free_cmd_buffer_locked(vk, pool->queue, pool->pool, cmd_buffer);
117142}
118143119144/*!
···184209 struct vk_bundle *vk, struct vk_cmd_pool *pool, uint32_t count, const VkSubmitInfo *infos, VkFence fence)
185210{
186211 vk_cmd_pool_lock(pool);
187187- VkResult ret = vk_cmd_submit_locked(vk, count, infos, fence);
212212+ VkResult ret = vk_cmd_submit_locked(vk, pool->queue, count, infos, fence);
188213 vk_cmd_pool_unlock(pool);
189214 return ret;
190215}
+1-1
src/xrt/compositor/main/comp_renderer.c
···665665 * us avoid taking a lot of locks. The queue lock will be taken by
666666 * @ref vk_cmd_submit_locked tho.
667667 */
668668- ret = vk_cmd_submit_locked(vk, 1, &comp_submit_info, r->fences[r->acquired_buffer]);
668668+ ret = vk_cmd_submit_locked(vk, &vk->main_queue, 1, &comp_submit_info, r->fences[r->acquired_buffer]);
669669670670 // We have now completed the submit, even if we failed.
671671 comp_target_mark_submit_end(ct, frame_id, os_monotonic_get_ns());
+1-1
src/xrt/compositor/main/comp_window_peek.c
···434434 };
435435436436 // Done writing commands, submit to queue.
437437- ret = vk_cmd_submit_locked(vk, 1, &submit, VK_NULL_HANDLE);
437437+ ret = vk_cmd_submit_locked(vk, &vk->main_queue, 1, &submit, VK_NULL_HANDLE);
438438439439 // Done submitting commands, unlock pool.
440440 vk_cmd_pool_unlock(&w->pool);
+1-1
src/xrt/compositor/render/render_resources.c
···657657 r->mock.color.image); // dst
658658 VK_CHK_WITH_RET(ret, "prepare_mock_image_locked", false);
659659660660- ret = vk_cmd_end_submit_wait_and_free_cmd_buffer_locked(vk, r->cmd_pool, cmd);
660660+ ret = vk_cmd_end_submit_wait_and_free_cmd_buffer_locked(vk, &vk->main_queue, r->cmd_pool, cmd);
661661 VK_CHK_WITH_RET(ret, "vk_cmd_end_submit_wait_and_free_cmd_buffer_locked", false);
662662663663 // No need to wait, submit waits on the fence.