summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_queue.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-02-27 16:34:13 -0800
committerJason Ekstrand <[email protected]>2017-08-15 19:08:26 -0700
commit017cdb10cf5001d018b65eeec4b06ebeacbb5593 (patch)
tree13eb65fc54732c45ad17bd5260fb39fc6bebf024 /src/intel/vulkan/anv_queue.c
parent031f57eba3719c8dd6462ebd2af696d2632d71b8 (diff)
anv: Submit a dummy batch when only semaphores are provided.
Vulkan allows you to do a submit whose only job is to wait on and trigger semaphores. The easiest way for us to support that right now is to insert a dummy execbuf. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_queue.c')
-rw-r--r--src/intel/vulkan/anv_queue.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index 9a0789ca322..039dfd7e2dc 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -159,6 +159,23 @@ VkResult anv_QueueSubmit(
pthread_mutex_lock(&device->mutex);
for (uint32_t i = 0; i < submitCount; i++) {
+ 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,
+ * come up with something more efficient but this shouldn't be a
+ * common case.
+ */
+ result = anv_cmd_buffer_execbuf(device, NULL,
+ pSubmits[i].pWaitSemaphores,
+ pSubmits[i].waitSemaphoreCount,
+ pSubmits[i].pSignalSemaphores,
+ pSubmits[i].signalSemaphoreCount);
+ if (result != VK_SUCCESS)
+ goto out;
+
+ continue;
+ }
+
for (uint32_t j = 0; j < pSubmits[i].commandBufferCount; j++) {
ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer,
pSubmits[i].pCommandBuffers[j]);