anv: return VK_ERROR_DEVICE_LOST immeditely when device is known to be lost

If we know the device has been lost we should return this error code for
any command that can report it before we attempt to do anything with the
device.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Iago Toral Quiroga
2017-03-22 09:18:56 +01:00
parent 50c8d2c1f7
commit 4da1832c00
2 changed files with 24 additions and 1 deletions

View File

@@ -150,6 +150,9 @@ VkResult genX(GetQueryPoolResults)(
pool->type == VK_QUERY_TYPE_PIPELINE_STATISTICS ||
pool->type == VK_QUERY_TYPE_TIMESTAMP);
if (unlikely(device->lost))
return VK_ERROR_DEVICE_LOST;
if (pData == NULL)
return VK_SUCCESS;