aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Pipeline.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-08-11 20:21:56 -0300
committerGitHub <noreply@github.com>2022-08-11 20:21:56 -0300
commite8f1ca84277240c4d6215eb9cd85713aab73e2f7 (patch)
tree9cc785a705678a3e7e00232a2bd3b00279cdac04 /Ryujinx.Graphics.OpenGL/Pipeline.cs
parentad47bd2d4ef72e4489f037056ead0a5d021694cc (diff)
OpenGL: Limit vertex buffer range for non-indexed draws (#3542)1.1.213
* Limit vertex buffer range for non-indexed draws * Fix typo
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Pipeline.cs21
1 files changed, 16 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs
index fc28c86e..d7cd6fbd 100644
--- a/Ryujinx.Graphics.OpenGL/Pipeline.cs
+++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs
@@ -236,7 +236,7 @@ namespace Ryujinx.Graphics.OpenGL
return;
}
- PreDraw();
+ PreDraw(vertexCount);
if (_primitiveType == PrimitiveType.Quads && !HwCapabilities.SupportsQuads)
{
@@ -354,7 +354,7 @@ namespace Ryujinx.Graphics.OpenGL
return;
}
- PreDraw();
+ PreDrawVbUnbounded();
int indexElemSize = 1;
@@ -686,7 +686,7 @@ namespace Ryujinx.Graphics.OpenGL
return;
}
- PreDraw();
+ PreDrawVbUnbounded();
GL.BindBuffer((BufferTarget)All.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32());
GL.BindBuffer((BufferTarget)All.ParameterBuffer, parameterBuffer.Handle.ToInt32());
@@ -709,7 +709,7 @@ namespace Ryujinx.Graphics.OpenGL
return;
}
- PreDraw();
+ PreDrawVbUnbounded();
_vertexArray.SetRangeOfIndexBuffer();
@@ -1515,11 +1515,22 @@ namespace Ryujinx.Graphics.OpenGL
_supportBuffer.Commit();
}
+ private void PreDraw(int vertexCount)
+ {
+ _vertexArray.PreDraw(vertexCount);
+ PreDraw();
+ }
+
+ private void PreDrawVbUnbounded()
+ {
+ _vertexArray.PreDrawVbUnbounded();
+ PreDraw();
+ }
+
private void PreDraw()
{
DrawCount++;
- _vertexArray.Validate();
_unit0Texture?.Bind(0);
_supportBuffer.Commit();
}