From fefd4619a5347b4ef86314a4e17e1d6e63ced297 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Fri, 25 Jun 2021 20:11:54 -0300 Subject: Add support for custom line widths (#2406) --- Ryujinx.Graphics.Gpu/Engine/Methods.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (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 39b3d13c..96741cd6 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs @@ -223,12 +223,17 @@ namespace Ryujinx.Graphics.Gpu.Engine UpdateTexturePoolState(state); } - // Input assembler state. + // Rasterizer state. if (state.QueryModified(MethodOffset.VertexAttribState)) { UpdateVertexAttribState(state); } + if (state.QueryModified(MethodOffset.LineWidthSmooth, MethodOffset.LineSmoothEnable)) + { + UpdateLineState(state); + } + if (state.QueryModified(MethodOffset.PointSize, MethodOffset.VertexProgramPointSize, MethodOffset.PointSpriteEnable, @@ -716,6 +721,18 @@ namespace Ryujinx.Graphics.Gpu.Engine _context.Renderer.Pipeline.SetVertexAttribs(vertexAttribs); } + /// + /// Updates host line width based on guest GPU state. + /// + /// Current GPU state + private void UpdateLineState(GpuState state) + { + float width = state.Get(MethodOffset.LineWidthSmooth); + bool smooth = state.Get(MethodOffset.LineSmoothEnable); + + _context.Renderer.Pipeline.SetLineParameters(width, smooth); + } + /// /// Updates host point size based on guest GPU state. /// -- cgit v1.2.3