Index: src/gpu/vk/GrVkGpu.cpp |
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp |
index 82e7394330459fa6ccd78c4db6cac7ad63503682..4d410a7b3a4ab289b91d7831b07d66a65e184b93 100644 |
--- a/src/gpu/vk/GrVkGpu.cpp |
+++ b/src/gpu/vk/GrVkGpu.cpp |
@@ -177,8 +177,15 @@ GrVkGpu::~GrVkGpu() { |
#endif |
#endif |
- // VK_ERROR_DEVICE_LOST is acceptable when tearing down (see 4.2.4 in spec) |
- SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res); |
+#ifdef SK_DEBUG |
+ if (this->vkCaps().allowInitializationErrorOnTearDown()) { |
+ SkASSERT(VK_SUCCESS == res || |
+ VK_ERROR_DEVICE_LOST == res || |
+ VK_ERROR_INITIALIZATION_FAILED == res); |
+ } else { |
+ SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res); |
+ } |
+#endif |
// must call this just before we destroy the VkDevice |
fResourceProvider.destroyResources(); |