anv: No-op submit and wait calls when no_hw is set
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3734>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3734>
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index b93d070..b9e1961 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -564,6 +564,9 @@
anv_queue_submit_simple_batch(struct anv_queue *queue,
struct anv_batch *batch)
{
+ if (queue->device->no_hw)
+ return VK_SUCCESS;
+
struct anv_device *device = queue->device;
struct anv_queue_submit *submit = anv_queue_submit_alloc(device);
if (!submit)
@@ -947,6 +950,9 @@
{
ANV_FROM_HANDLE(anv_queue, queue, _queue);
+ if (queue->device->no_hw)
+ return VK_SUCCESS;
+
/* Query for device status prior to submitting. Technically, we don't need
* to do this. However, if we have a client that's submitting piles of
* garbage, we would rather break as early as possible to keep the GPU
@@ -1537,6 +1543,9 @@
{
ANV_FROM_HANDLE(anv_device, device, _device);
+ if (device->no_hw)
+ return VK_SUCCESS;
+
if (anv_device_is_lost(device))
return VK_ERROR_DEVICE_LOST;
@@ -2282,6 +2291,9 @@
{
ANV_FROM_HANDLE(anv_device, device, _device);
+ if (device->no_hw)
+ return VK_SUCCESS;
+
struct anv_timeline **timelines =
vk_alloc(&device->alloc,
pWaitInfo->semaphoreCount * sizeof(*timelines),