From cfec381073d7136b9c45cea95a6f8f0cd0945086 Mon Sep 17 00:00:00 2001 From: Andy Adshead Date: Sat, 5 Jan 2019 02:20:24 +0000 Subject: [PATCH] Apply to all viewports when geometry shaders are disabled. --- Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs index cec0bd6f4d..05872438ac 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs @@ -298,8 +298,17 @@ namespace Ryujinx.Graphics.Gal.OpenGL New.ScissorTestHeight[Index] != Old.ScissorTestHeight[Index] || forceUpdate)) // Force update intentionally last to reduce if comparisons { - GL.ScissorIndexed(Index, New.ScissorTestX[Index], New.ScissorTestY[Index], - New.ScissorTestWidth[Index], New.ScissorTestHeight[Index]); + // If there is only 1 scissor test geometry shaders are disables so the scissor test applies to all viewports + if (New.ScissorTestCount == 1) + { + GL.Scissor(New.ScissorTestX[Index], New.ScissorTestY[Index], + New.ScissorTestWidth[Index], New.ScissorTestHeight[Index]); + } + else + { + GL.ScissorIndexed(Index, New.ScissorTestX[Index], New.ScissorTestY[Index], + New.ScissorTestWidth[Index], New.ScissorTestHeight[Index]); + } } }