aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Methods.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Methods.cs80
1 files changed, 15 insertions, 65 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
index 5d90573c..5d156312 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
@@ -227,40 +227,29 @@ namespace Ryujinx.Graphics.Gpu.Engine
int samplesInX = msaaMode.SamplesInX();
int samplesInY = msaaMode.SamplesInY();
- Image.Texture color3D = Get3DRenderTarget(samplesInX, samplesInY);
-
- if (color3D == null)
+ for (int index = 0; index < Constants.TotalRenderTargets; index++)
{
- for (int index = 0; index < Constants.TotalRenderTargets; index++)
- {
- var colorState = _context.State.Get<RtColorState>(MethodOffset.RtColorState, index);
+ var colorState = _context.State.Get<RtColorState>(MethodOffset.RtColorState, index);
- if (!IsRtEnabled(colorState))
- {
- _textureManager.SetRenderTargetColor(index, null);
+ if (!IsRtEnabled(colorState))
+ {
+ _textureManager.SetRenderTargetColor(index, null);
- continue;
- }
+ continue;
+ }
- Image.Texture color = _textureManager.FindOrCreateTexture(
- colorState,
- samplesInX,
- samplesInY);
+ Image.Texture color = _textureManager.FindOrCreateTexture(
+ colorState,
+ samplesInX,
+ samplesInY);
- _textureManager.SetRenderTargetColor(index, color);
+ _textureManager.SetRenderTargetColor(index, color);
- if (color != null)
- {
- color.Modified = true;
- }
+ if (color != null)
+ {
+ color.Modified = true;
}
}
- else
- {
- _textureManager.SetRenderTargetColor3D(color3D);
-
- color3D.Modified = true;
- }
bool dsEnable = _context.State.Get<Boolean32>(MethodOffset.RtDepthStencilEnable);
@@ -286,45 +275,6 @@ namespace Ryujinx.Graphics.Gpu.Engine
}
}
- private Image.Texture Get3DRenderTarget(int samplesInX, int samplesInY)
- {
- var colorState0 = _context.State.Get<RtColorState>(MethodOffset.RtColorState, 0);
-
- if (!IsRtEnabled(colorState0) || !colorState0.MemoryLayout.UnpackIsTarget3D() || colorState0.Depth != 1)
- {
- return null;
- }
-
- int slices = 1;
- int unused = 0;
-
- for (int index = 1; index < Constants.TotalRenderTargets; index++)
- {
- var colorState = _context.State.Get<RtColorState>(MethodOffset.RtColorState, index);
-
- if (!IsRtEnabled(colorState))
- {
- unused++;
-
- continue;
- }
-
- if (colorState.MemoryLayout.UnpackIsTarget3D() && colorState.Depth == 1)
- {
- slices++;
- }
- }
-
- if (slices + unused == Constants.TotalRenderTargets)
- {
- colorState0.Depth = slices;
-
- return _textureManager.FindOrCreateTexture(colorState0, samplesInX, samplesInY);
- }
-
- return null;
- }
-
private static bool IsRtEnabled(RtColorState colorState)
{
// Colors are disabled by writing 0 to the format.