diff options
author | riperiperi <rhy3756547@hotmail.com> | 2022-03-20 17:48:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-20 14:48:43 -0300 |
commit | d1146a5af20dcda5bb6bf8cb2f702bca1c789408 (patch) | |
tree | ab08a6af08c3fefd410fa448b57fd0de4041d8f4 /Ryujinx.Graphics.OpenGL/Pipeline.cs | |
parent | 79408b68c3e72c26d42f858089d97d77d58b44d9 (diff) |
Don't restore Viewport 0 if it hasn't been set yet. (#3219)1.1.81
Fixes a driver crash when starting some games caused by #3217
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-rw-r--r-- | Ryujinx.Graphics.OpenGL/Pipeline.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index 35278629..114fa685 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -612,7 +612,7 @@ namespace Ryujinx.Graphics.OpenGL _program?.Bind(); _unit0Sampler?.Bind(0); - GL.ViewportArray(0, 1, _viewportArray); + RestoreViewport0(); Enable(EnableCap.CullFace, _cullEnable); Enable(EnableCap.StencilTest, _stencilTestEnable); @@ -1501,7 +1501,10 @@ namespace Ryujinx.Graphics.OpenGL public void RestoreViewport0() { - GL.ViewportArray(0, 1, _viewportArray); + if (_viewportArray.Length > 0) + { + GL.ViewportArray(0, 1, _viewportArray); + } } public bool TryHostConditionalRendering(ICounterEvent value, ulong compare, bool isEqual) |