Permalink
Browse files

GLES: Correct invalid scissor handling.

Also improves Direct3D 9.  See #11444.

Per hardware tests, we should correctly not draw in this case.
  • Loading branch information...
unknownbrackets committed Oct 28, 2018
1 parent 5ea935f commit 29b55814160bc021812360fa5f1f58106b2b4e52
Showing with 11 additions and 4 deletions.
  1. +11 −4 GPU/Common/GPUStateUtils.cpp
@@ -571,10 +571,17 @@ void ConvertViewportAndScissor(bool useBufferedRendering, float renderWidth, flo
// This is a bit of a hack as the render buffer isn't always that size
// We always scissor on non-buffered so that clears don't spill outside the frame.
out.scissorEnable = true;
out.scissorX = renderX + displayOffsetX + scissorX1 * renderWidthFactor;
out.scissorY = renderY + displayOffsetY + scissorY1 * renderHeightFactor;
out.scissorW = (scissorX2 - scissorX1) * renderWidthFactor;
out.scissorH = (scissorY2 - scissorY1) * renderHeightFactor;
if (scissorX2 < scissorX1 || scissorY2 < scissorY1) {
out.scissorX = 0;
out.scissorY = 0;
out.scissorW = 0;
out.scissorH = 0;
} else {
out.scissorX = renderX + displayOffsetX + scissorX1 * renderWidthFactor;
out.scissorY = renderY + displayOffsetY + scissorY1 * renderHeightFactor;
out.scissorW = (scissorX2 - scissorX1) * renderWidthFactor;
out.scissorH = (scissorY2 - scissorY1) * renderHeightFactor;
}
int curRTWidth = gstate_c.curRTWidth;
int curRTHeight = gstate_c.curRTHeight;

0 comments on commit 29b5581

Please sign in to comment.