Skip to content

Commit

Permalink
GPU: Never set safe size larger than the buffer.
Browse files Browse the repository at this point in the history
Maybe this indicates the buffer size is wrong, but a safe size larger than
the buffer will make us try to download outside the buffer and lose the
Vulkan device.
  • Loading branch information
unknownbrackets committed May 23, 2020
1 parent 1dec772 commit 3a1bc6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GPU/Common/FramebufferCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,8 +1686,8 @@ void FramebufferManagerCommon::SetRenderSize(VirtualFramebuffer *vfb) {
void FramebufferManagerCommon::SetSafeSize(u16 w, u16 h) {
VirtualFramebuffer *vfb = currentRenderVfb_;
if (vfb) {
vfb->safeWidth = std::max(vfb->safeWidth, w);
vfb->safeHeight = std::max(vfb->safeHeight, h);
vfb->safeWidth = std::min(vfb->bufferWidth, std::max(vfb->safeWidth, w));
vfb->safeHeight = std::min(vfb->bufferHeight, std::max(vfb->safeHeight, h));
}
}

Expand Down

0 comments on commit 3a1bc6a

Please sign in to comment.