aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Methods.cs
diff options
context:
space:
mode:
authormageven <62494521+mageven@users.noreply.github.com>2020-07-21 06:29:13 +0530
committerGitHub <noreply@github.com>2020-07-20 21:59:13 -0300
commit723ae240dcb6ff8b03d1187cdbd81f20424bac52 (patch)
tree1e83917b466d6435b65cd46826ac692ff45204f0 /Ryujinx.Graphics.Gpu/Engine/Methods.cs
parent1c84b683c2cc9ffab3ebedca92396ca12c82da9d (diff)
GL: Implement more Point parameters (#1399)
* Fix GL_INVALID_VALUE on glPointSize calls * Implement more of Point primitive state * Use existing Origin enum
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Methods.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
index 093f9048..df0e713d 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
@@ -224,9 +224,12 @@ namespace Ryujinx.Graphics.Gpu.Engine
UpdateVertexAttribState(state);
}
- if (state.QueryModified(MethodOffset.PointSize))
+ if (state.QueryModified(MethodOffset.PointSize,
+ MethodOffset.VertexProgramPointSize,
+ MethodOffset.PointSpriteEnable,
+ MethodOffset.PointCoordReplace))
{
- UpdatePointSizeState(state);
+ UpdatePointState(state);
}
if (state.QueryModified(MethodOffset.PrimitiveRestartState))
@@ -703,11 +706,16 @@ namespace Ryujinx.Graphics.Gpu.Engine
/// Updates host point size based on guest GPU state.
/// </summary>
/// <param name="state">Current GPU state</param>
- private void UpdatePointSizeState(GpuState state)
+ private void UpdatePointState(GpuState state)
{
float size = state.Get<float>(MethodOffset.PointSize);
+ bool isProgramPointSize = state.Get<Boolean32>(MethodOffset.VertexProgramPointSize);
+ bool enablePointSprite = state.Get<Boolean32>(MethodOffset.PointSpriteEnable);
+
+ // TODO: Need to figure out a way to map PointCoordReplace enable bit.
+ Origin origin = (state.Get<int>(MethodOffset.PointCoordReplace) & 4) == 0 ? Origin.LowerLeft : Origin.UpperLeft;
- _context.Renderer.Pipeline.SetPointSize(size);
+ _context.Renderer.Pipeline.SetPointParameters(size, isProgramPointSize, enablePointSprite, origin);
}
/// <summary>