aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/NvGpuEngine3d.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-10-17 18:02:23 -0300
committerGitHub <noreply@github.com>2018-10-17 18:02:23 -0300
commit0e1e094b7a8f0134831fc4cebdb0841b9c10fe6a (patch)
tree81ba6446851a033f27adeafbfb94751032108047 /Ryujinx.Graphics/NvGpuEngine3d.cs
parent02a8e7fc9369d7882db08a69d108beefb0f98677 (diff)
Improve texture tables (#457)
* Improve texture tables * More renaming and other tweaks * Minor tweaks
Diffstat (limited to 'Ryujinx.Graphics/NvGpuEngine3d.cs')
-rw-r--r--Ryujinx.Graphics/NvGpuEngine3d.cs47
1 files changed, 25 insertions, 22 deletions
diff --git a/Ryujinx.Graphics/NvGpuEngine3d.cs b/Ryujinx.Graphics/NvGpuEngine3d.cs
index a2a96928..fd15d0b6 100644
--- a/Ryujinx.Graphics/NvGpuEngine3d.cs
+++ b/Ryujinx.Graphics/NvGpuEngine3d.cs
@@ -141,7 +141,7 @@ namespace Ryujinx.Graphics
{
int Arg0 = PBEntry.Arguments[0];
- int FbIndex = (Arg0 >> 6) & 0xf;
+ int Attachment = (Arg0 >> 6) & 0xf;
GalClearBufferFlags Flags = (GalClearBufferFlags)(Arg0 & 0x3f);
@@ -154,7 +154,7 @@ namespace Ryujinx.Graphics
int Stencil = ReadRegister(NvGpuEngine3dReg.ClearStencil);
- SetFrameBuffer(Vmm, FbIndex);
+ SetFrameBuffer(Vmm, Attachment);
SetZeta(Vmm);
@@ -162,12 +162,10 @@ namespace Ryujinx.Graphics
Gpu.Renderer.RenderTarget.Bind();
- Gpu.Renderer.Rasterizer.ClearBuffers(
- Flags,
- FbIndex,
- Red, Green, Blue, Alpha,
- Depth,
- Stencil);
+ Gpu.Renderer.Rasterizer.ClearBuffers(Flags, Attachment, Red, Green, Blue, Alpha, Depth, Stencil);
+
+ Gpu.Renderer.Pipeline.ResetDepthMask();
+ Gpu.Renderer.Pipeline.ResetColorMask(Attachment);
}
private void SetFrameBuffer(NvGpuVmm Vmm, int FbIndex)
@@ -345,13 +343,8 @@ namespace Ryujinx.Graphics
{
switch (FrontFace)
{
- case GalFrontFace.CW:
- FrontFace = GalFrontFace.CCW;
- break;
-
- case GalFrontFace.CCW:
- FrontFace = GalFrontFace.CW;
- break;
+ case GalFrontFace.CW: FrontFace = GalFrontFace.CCW; break;
+ case GalFrontFace.CCW: FrontFace = GalFrontFace.CW; break;
}
}
@@ -426,10 +419,20 @@ namespace Ryujinx.Graphics
{
int ColorMask = ReadRegister(NvGpuEngine3dReg.ColorMask);
- State.ColorMaskR = ((ColorMask >> 0) & 0xf) != 0;
- State.ColorMaskG = ((ColorMask >> 4) & 0xf) != 0;
- State.ColorMaskB = ((ColorMask >> 8) & 0xf) != 0;
- State.ColorMaskA = ((ColorMask >> 12) & 0xf) != 0;
+ State.ColorMask.Red = ((ColorMask >> 0) & 0xf) != 0;
+ State.ColorMask.Green = ((ColorMask >> 4) & 0xf) != 0;
+ State.ColorMask.Blue = ((ColorMask >> 8) & 0xf) != 0;
+ State.ColorMask.Alpha = ((ColorMask >> 12) & 0xf) != 0;
+
+ for (int Index = 0; Index < GalPipelineState.RenderTargetsCount; Index++)
+ {
+ ColorMask = ReadRegister(NvGpuEngine3dReg.ColorMaskN + Index);
+
+ State.ColorMasks[Index].Red = ((ColorMask >> 0) & 0xf) != 0;
+ State.ColorMasks[Index].Green = ((ColorMask >> 4) & 0xf) != 0;
+ State.ColorMasks[Index].Blue = ((ColorMask >> 8) & 0xf) != 0;
+ State.ColorMasks[Index].Alpha = ((ColorMask >> 12) & 0xf) != 0;
+ }
}
private void SetPrimitiveRestart(GalPipelineState State)
@@ -455,11 +458,11 @@ namespace Ryujinx.Graphics
{
int[] Map = new int[Count];
- for (int i = 0; i < Count; i++)
+ for (int Index = 0; Index < Count; Index++)
{
- int Shift = 4 + i * 3;
+ int Shift = 4 + Index * 3;
- Map[i] = (int)((Control >> Shift) & 7);
+ Map[Index] = (int)((Control >> Shift) & 7);
}
Gpu.Renderer.RenderTarget.SetMap(Map);