diff options
author | gdk <gab.dark.100@gmail.com> | 2019-10-30 20:45:01 -0300 |
---|---|---|
committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
commit | d786d8d2b924da7cd116a2eb97d738a9f07b4e43 (patch) | |
tree | 0e84072c554066d20622d156d1394144ed5258bd /Ryujinx.Graphics.Gpu/Engine/Methods.cs | |
parent | 3bcc395253e020df40763d36ba9401b126b17173 (diff) |
Support copy of slices to 3D textures, remove old 3D render target layered render support, do not delete textures with existing views created from them
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Methods.cs | 80 |
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. |