aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TextureManager.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2020-11-20 20:14:45 +0000
committerGitHub <noreply@github.com>2020-11-20 17:14:45 -0300
commit9493cdfe553d77d8f37927ef2acf87cfbab1c467 (patch)
tree9c5e5b588c1fa9372274d3d780b4cbb041bf24c5 /Ryujinx.Graphics.Gpu/Image/TextureManager.cs
parentcf7044e37bc628f25525941d25b830594b833428 (diff)
Allow copy destination to have a different scale from source (#1711)
* Allow copy destination to have a different scale from source Will result in more scaled copy destinations, but allows scaling in some games that copy textures to the output framebuffer. * Support copying multiple levels/layers Uses glFramebufferTextureLayer to copy multiple layers, copies levels individually (and scales the regions). Remove CopyArrayScaled, since the backend copy handles it now.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureManager.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureManager.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs
index f1d31f4f..8e64ca61 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs
@@ -387,7 +387,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <returns>True if eligible</returns>
public bool IsUpscaleCompatible(TextureInfo info)
{
- return (info.Target == Target.Texture2D || info.Target == Target.Texture2DArray) && info.Levels == 1 && !info.FormatInfo.IsCompressed && UpscaleSafeMode(info);
+ return (info.Target == Target.Texture2D || info.Target == Target.Texture2DArray) && !info.FormatInfo.IsCompressed && UpscaleSafeMode(info);
}
/// <summary>
@@ -401,6 +401,13 @@ namespace Ryujinx.Graphics.Gpu.Image
// While upscaling works for all targets defined by IsUpscaleCompatible, we additionally blacklist targets here that
// may have undesirable results (upscaling blur textures) or simply waste GPU resources (upscaling texture atlas).
+ if (info.Levels > 3)
+ {
+ // Textures with more than 3 levels are likely to be game textures, rather than render textures.
+ // Small textures with full mips are likely to be removed by the next check.
+ return false;
+ }
+
if (!(info.FormatInfo.Format.IsDepthOrStencil() || info.FormatInfo.Components == 1))
{
// Discount square textures that aren't depth-stencil like. (excludes game textures, cubemap faces, most 3D texture LUT, texture atlas)