Merge pull request #12856 from hrydgard/vulkan-discard-negative-rects

Vulkan: Discard negative width/height framebuffer blits.
This commit is contained in:
Henrik Rydgård 2020-04-26 22:08:57 +02:00 committed by GitHub
commit 646c3b749e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -493,8 +493,10 @@ void FramebufferManagerVulkan::BlitFramebuffer(VirtualFramebuffer *dst, int dstX
h -= srcY + h - src->bufferHeight;
}
if (w == 0 || h == 0)
if (w <= 0 || h <= 0) {
// The whole rectangle got clipped.
return;
}
float srcXFactor = (float)src->renderWidth / (float)src->bufferWidth;
float srcYFactor = (float)src->renderHeight / (float)src->bufferHeight;