From 0e1e094b7a8f0134831fc4cebdb0841b9c10fe6a Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 17 Oct 2018 18:02:23 -0300 Subject: Improve texture tables (#457) * Improve texture tables * More renaming and other tweaks * Minor tweaks --- Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs | 38 +++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs') diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs index b7825996..00699641 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs @@ -129,9 +129,16 @@ namespace Ryujinx.Graphics.Gal.OpenGL BlendFuncSrcAlpha = GalBlendFactor.One, BlendFuncDstAlpha = GalBlendFactor.Zero, + ColorMask = ColorMaskRgba.Default, + PrimitiveRestartEnabled = false, PrimitiveRestartIndex = 0 }; + + for (int Index = 0; Index < GalPipelineState.RenderTargetsCount; Index++) + { + Old.ColorMasks[Index] = ColorMaskRgba.Default; + } } public void Bind(GalPipelineState New) @@ -177,8 +184,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL if (New.DepthWriteEnabled != Old.DepthWriteEnabled) { - Rasterizer.DepthWriteEnabled = New.DepthWriteEnabled; - GL.DepthMask(New.DepthWriteEnabled); } @@ -303,16 +308,17 @@ namespace Ryujinx.Graphics.Gal.OpenGL } } - if (New.ColorMaskR != Old.ColorMaskR || - New.ColorMaskG != Old.ColorMaskG || - New.ColorMaskB != Old.ColorMaskB || - New.ColorMaskA != Old.ColorMaskA) + for (int Index = 0; Index < GalPipelineState.RenderTargetsCount; Index++) { - GL.ColorMask( - New.ColorMaskR, - New.ColorMaskG, - New.ColorMaskB, - New.ColorMaskA); + if (!New.ColorMasks[Index].Equals(Old.ColorMasks[Index])) + { + GL.ColorMask( + Index, + New.ColorMasks[Index].Red, + New.ColorMasks[Index].Green, + New.ColorMasks[Index].Blue, + New.ColorMasks[Index].Alpha); + } } if (New.PrimitiveRestartEnabled != Old.PrimitiveRestartEnabled) @@ -613,5 +619,15 @@ namespace Ryujinx.Graphics.Gal.OpenGL GL.Disable(Cap); } } + + public void ResetDepthMask() + { + Old.DepthWriteEnabled = true; + } + + public void ResetColorMask(int Index) + { + Old.ColorMasks[Index] = ColorMaskRgba.Default; + } } } \ No newline at end of file -- cgit v1.2.3