From 723ae240dcb6ff8b03d1187cdbd81f20424bac52 Mon Sep 17 00:00:00 2001 From: mageven <62494521+mageven@users.noreply.github.com> Date: Tue, 21 Jul 2020 06:29:13 +0530 Subject: GL: Implement more Point parameters (#1399) * Fix GL_INVALID_VALUE on glPointSize calls * Implement more of Point primitive state * Use existing Origin enum --- Ryujinx.Graphics.Gpu/Engine/Methods.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs') 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. /// /// Current GPU state - private void UpdatePointSizeState(GpuState state) + private void UpdatePointState(GpuState state) { float size = state.Get(MethodOffset.PointSize); + bool isProgramPointSize = state.Get(MethodOffset.VertexProgramPointSize); + bool enablePointSprite = state.Get(MethodOffset.PointSpriteEnable); + + // TODO: Need to figure out a way to map PointCoordReplace enable bit. + Origin origin = (state.Get(MethodOffset.PointCoordReplace) & 4) == 0 ? Origin.LowerLeft : Origin.UpperLeft; - _context.Renderer.Pipeline.SetPointSize(size); + _context.Renderer.Pipeline.SetPointParameters(size, isProgramPointSize, enablePointSprite, origin); } /// -- cgit v1.2.3