Handle all failures for vkWaitForFences

Bug: chromium:1019469
Change-Id: Ic32be65775cf6b7d3261d1d8b4076363d0e65874
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251821
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Emircan Uysaler 2019-10-31 15:33:31 -04:00 committed by Skia Commit-Bot
parent f5ad3f421e
commit 283ec65f63
2 changed files with 10 additions and 7 deletions

View File

@ -580,11 +580,10 @@ void GrVkPrimaryCommandBuffer::submitToQueue(
if (GrVkGpu::kForce_SyncQueue == sync) {
err = GR_VK_CALL(gpu->vkInterface(),
WaitForFences(gpu->device(), 1, &fSubmitFence, true, UINT64_MAX));
if (VK_TIMEOUT == err) {
SkDebugf("Fence failed to signal: %d\n", err);
if (VK_SUCCESS != err) {
SkDebugf("Fence failed: %d\n", err);
SK_ABORT("failing");
}
SkASSERT(!err);
fFinishedProcs.reset();

View File

@ -1753,7 +1753,7 @@ bool GrVkGpu::createVkImageForBackendSurface(VkFormat vkFormat, int w, int h, bo
SkASSERT(!err);
err = VK_CALL(WaitForFences(this->device(), 1, &fence, VK_TRUE, UINT64_MAX));
if (VK_TIMEOUT == err) {
if (VK_SUCCESS != err) {
GrVkImage::DestroyImageInfo(this, info);
if (buffer != VK_NULL_HANDLE) { // workaround for an older NVidia driver crash
GrVkMemory::FreeBufferMemory(this, GrVkBuffer::kCopyRead_Type, bufferAlloc);
@ -1761,10 +1761,14 @@ bool GrVkGpu::createVkImageForBackendSurface(VkFormat vkFormat, int w, int h, bo
}
VK_CALL(FreeCommandBuffers(fDevice, fCmdPool->vkCommandPool(), 1, &cmdBuffer));
VK_CALL(DestroyFence(this->device(), fence, nullptr));
SkDebugf("Fence failed to signal: %d\n", err);
SK_ABORT("failing");
if (VK_TIMEOUT == err) {
SkDebugf("Fence failed to signal: %d\n", err);
SK_ABORT("failing");
} else {
SkDebugf("Fence failed: %d\n", err);
return false;
}
}
SkASSERT(!err);
// Clean up transfer resources
if (buffer != VK_NULL_HANDLE) { // workaround for an older NVidia driver crash