queue = &device->queues[queueFamilyIndex][queueIndex];
*pQueue = libresoc_queue_to_handle(queue);
}
+
+VkResult libresoc_QueueWaitIdle(
+ VkQueue _queue)
+{
+ LIBRESOC_FROM_HANDLE(libresoc_queue, queue, _queue);
+
+ pthread_mutex_lock(&queue->pending_mutex);
+ while (!list_is_empty(&queue->pending_submissions)) {
+ pthread_cond_wait(&queue->device->timeline_cond, &queue->pending_mutex);
+ }
+ pthread_mutex_unlock(&queue->pending_mutex);
+
+ return VK_SUCCESS;
+}
+
+VkResult libresoc_DeviceWaitIdle(
+ VkDevice _device)
+{
+ LIBRESOC_FROM_HANDLE(libresoc_device, device, _device);
+
+ for (unsigned i = 0; i < LIBRESOC_MAX_QUEUE_FAMILIES; i++) {
+ for (unsigned q = 0; q < device->queue_count[i]; q++) {
+ VkResult result =
+ libresoc_QueueWaitIdle(libresoc_queue_to_handle(&device->queues[i][q]));
+
+ if (result != VK_SUCCESS)
+ return result;
+ }
+ }
+ return VK_SUCCESS;
+}
/* Backup in-memory cache to be used if the app doesn't provide one */
struct libresoc_pipeline_cache * mem_cache;
+ /* Condition variable for legacy timelines, to notify waiters when a
+ * new point gets submitted. */
+ pthread_cond_t timeline_cond;
/* FIXME: stub */
};
int queue_idx;
VkDeviceQueueCreateFlags flags;
+ struct list_head pending_submissions;
+ pthread_mutex_t pending_mutex;
/* FIXME: stub */
};