From: Jason Ekstrand Date: Tue, 16 Oct 2018 20:58:14 +0000 (-0500) Subject: anv: Plumb timeline semaphore signal/wait values through from the API X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a4f15ef2c0e3aeb0f7782296a29b1d6c1cba911;p=mesa.git anv: Plumb timeline semaphore signal/wait values through from the API Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 67049cc37fe..3174e5ea236 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2695,8 +2695,10 @@ void anv_cmd_buffer_prepare_execbuf(struct anv_cmd_buffer *cmd_buffer); VkResult anv_cmd_buffer_execbuf(struct anv_queue *queue, struct anv_cmd_buffer *cmd_buffer, const VkSemaphore *in_semaphores, + const uint64_t *in_wait_values, uint32_t num_in_semaphores, const VkSemaphore *out_semaphores, + const uint64_t *out_signal_values, uint32_t num_out_semaphores, VkFence fence); diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index 959b96aaaf2..dc476470b75 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -382,8 +382,10 @@ static VkResult anv_queue_submit(struct anv_queue *queue, struct anv_cmd_buffer *cmd_buffer, const VkSemaphore *in_semaphores, + const uint64_t *in_values, uint32_t num_in_semaphores, const VkSemaphore *out_semaphores, + const uint64_t *out_values, uint32_t num_out_semaphores, VkFence _fence) { @@ -590,7 +592,7 @@ VkResult anv_QueueSubmit( * come up with something more efficient but this shouldn't be a * common case. */ - result = anv_queue_submit(queue, NULL, NULL, 0, NULL, 0, fence); + result = anv_queue_submit(queue, NULL, NULL, NULL, 0, NULL, NULL, 0, fence); goto out; } @@ -598,6 +600,16 @@ VkResult anv_QueueSubmit( /* Fence for this submit. NULL for all but the last one */ VkFence submit_fence = (i == submitCount - 1) ? fence : VK_NULL_HANDLE; + const VkTimelineSemaphoreSubmitInfoKHR *timeline_info = + vk_find_struct_const(pSubmits[i].pNext, + TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR); + const uint64_t *wait_values = + timeline_info && timeline_info->waitSemaphoreValueCount ? + timeline_info->pWaitSemaphoreValues : NULL; + const uint64_t *signal_values = + timeline_info && timeline_info->signalSemaphoreValueCount ? + timeline_info->pSignalSemaphoreValues : NULL; + if (pSubmits[i].commandBufferCount == 0) { /* If we don't have any command buffers, we need to submit a dummy * batch to give GEM something to wait on. We could, potentially, @@ -606,8 +618,10 @@ VkResult anv_QueueSubmit( */ result = anv_queue_submit(queue, NULL, pSubmits[i].pWaitSemaphores, + wait_values, pSubmits[i].waitSemaphoreCount, pSubmits[i].pSignalSemaphores, + signal_values, pSubmits[i].signalSemaphoreCount, submit_fence); if (result != VK_SUCCESS) @@ -628,22 +642,25 @@ VkResult anv_QueueSubmit( submit_fence : VK_NULL_HANDLE; const VkSemaphore *in_semaphores = NULL, *out_semaphores = NULL; + const uint64_t *in_values = NULL, *out_values = NULL; uint32_t num_in_semaphores = 0, num_out_semaphores = 0; if (j == 0) { /* Only the first batch gets the in semaphores */ in_semaphores = pSubmits[i].pWaitSemaphores; + in_values = wait_values; num_in_semaphores = pSubmits[i].waitSemaphoreCount; } if (j == pSubmits[i].commandBufferCount - 1) { /* Only the last batch gets the out semaphores */ out_semaphores = pSubmits[i].pSignalSemaphores; + out_values = signal_values; num_out_semaphores = pSubmits[i].signalSemaphoreCount; } result = anv_queue_submit(queue, cmd_buffer, - in_semaphores, num_in_semaphores, - out_semaphores, num_out_semaphores, + in_semaphores, in_values, num_in_semaphores, + out_semaphores, out_values, num_out_semaphores, execbuf_fence); if (result != VK_SUCCESS) goto out;