diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-10-17 18:02:23 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-17 18:02:23 -0300 |
| commit | 0e1e094b7a8f0134831fc4cebdb0841b9c10fe6a (patch) | |
| tree | 81ba6446851a033f27adeafbfb94751032108047 /Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs | |
| parent | 02a8e7fc9369d7882db08a69d108beefb0f98677 (diff) | |
Improve texture tables (#457)
* Improve texture tables
* More renaming and other tweaks
* Minor tweaks
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs')
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs | 38 |
1 files changed, 27 insertions, 11 deletions
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 |
