aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Methods.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2020-11-10 00:41:13 +0000
committerGitHub <noreply@github.com>2020-11-09 21:41:13 -0300
commit02872833b6da02a20e331305caf05f722e6c8e68 (patch)
tree4f3948b1ee0ecb4849f0fcfb4cad8cd27c202d30 /Ryujinx.Graphics.Gpu/Engine/Methods.cs
parentc3d62bd0783a20efb78fa0776f4c620970774cf9 (diff)
Size hints for copy regions and viewport dimensions to avoid data loss (#1686)
* Size hints for copy regions and viewport dimensions to avoid data loss * Reword comment. * Use info for the rule rather than calculating aligned size. * Reorder min/max, remove spaces
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Methods.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
index ef073a25..cab125b5 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
@@ -5,6 +5,7 @@ using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.Graphics.Gpu.Shader;
using Ryujinx.Graphics.Gpu.State;
using Ryujinx.Graphics.Shader;
+using Ryujinx.Graphics.Texture;
using System;
using System.Linq;
using System.Runtime.InteropServices;
@@ -354,6 +355,9 @@ namespace Ryujinx.Graphics.Gpu.Engine
int samplesInX = msaaMode.SamplesInX();
int samplesInY = msaaMode.SamplesInY();
+ var extents = state.Get<ViewportExtents>(MethodOffset.ViewportExtents, 0);
+ Size sizeHint = new Size(extents.X + extents.Width, extents.Y + extents.Height, 1);
+
bool changedScale = false;
for (int index = 0; index < Constants.TotalRenderTargets; index++)
@@ -369,7 +373,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
continue;
}
- Texture color = TextureManager.FindOrCreateTexture(colorState, samplesInX, samplesInY);
+ Texture color = TextureManager.FindOrCreateTexture(colorState, samplesInX, samplesInY, sizeHint);
changedScale |= TextureManager.SetRenderTargetColor(index, color);
@@ -388,7 +392,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
var dsState = state.Get<RtDepthStencilState>(MethodOffset.RtDepthStencilState);
var dsSize = state.Get<Size3D>(MethodOffset.RtDepthStencilSize);
- depthStencil = TextureManager.FindOrCreateTexture(dsState, dsSize, samplesInX, samplesInY);
+ depthStencil = TextureManager.FindOrCreateTexture(dsState, dsSize, samplesInX, samplesInY, sizeHint);
}
changedScale |= TextureManager.SetRenderTargetDepthStencil(depthStencil);