Improve texture tables (#457)

* Improve texture tables

* More renaming and other tweaks

* Minor tweaks
This commit is contained in:
gdkchan 2018-10-17 18:02:23 -03:00 committed by GitHub
parent 02a8e7fc93
commit 0e1e094b7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 445 additions and 477 deletions

View file

@ -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;
}
}
}