diff options
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 3e1e6e1c804..61448d8dbdd 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2871,7 +2871,7 @@ _anv_device_set_lost(struct anv_device *device, VkResult err; va_list ap; - device->_lost = true; + p_atomic_inc(&device->_lost); va_start(ap, msg); err = __vk_errorv(device->instance, device, @@ -2886,6 +2886,28 @@ _anv_device_set_lost(struct anv_device *device, } VkResult +_anv_queue_set_lost(struct anv_queue *queue, + const char *file, int line, + const char *msg, ...) +{ + VkResult err; + va_list ap; + + p_atomic_inc(&queue->device->_lost); + + va_start(ap, msg); + err = __vk_errorv(queue->device->instance, queue->device, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + VK_ERROR_DEVICE_LOST, file, line, msg, ap); + va_end(ap); + + if (env_var_as_boolean("ANV_ABORT_ON_DEVICE_LOSS", false)) + abort(); + + return err; +} + +VkResult anv_device_query_status(struct anv_device *device) { /* This isn't likely as most of the callers of this function already check @@ -2963,7 +2985,7 @@ VkResult anv_DeviceWaitIdle( if (anv_device_is_lost(device)) return VK_ERROR_DEVICE_LOST; - return anv_device_submit_simple_batch(device, NULL); + return anv_queue_submit_simple_batch(&device->queue, NULL); } bool |