aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/Texture.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2021-05-24 08:35:26 +0100
committerGitHub <noreply@github.com>2021-05-24 17:35:26 +1000
commit79092310fa5510f3b8e9f1e0183de6dea9dad98a (patch)
tree414ca385f3ad2446c8f09e489f46437779b5ad6d /Ryujinx.Graphics.Gpu/Image/Texture.cs
parente9c15d32cbdd5d59373ede7d5dd15f4150ef3c4c (diff)
Compare aligned size for largest mip level when considering sampler resize (#2306)
* Compare aligned size for largest mip level when considering sampler resize When selecting a texture that's a view for a sampler resize, we should take care that resizing it doesn't change the aligned size of any larger mip levels. This PR covers two cases: - When creating a view of the texture, we check that the aligned size of the view shifted up to level 0 still matches the aligned size of the container. If it does not, a copy dependency is created rather than resizing. - When searching for a texture for sampler, textures that do _not_ match our aligned size when both are shifted up by its base level are not considered an exact match, as resizing the found texture will cause the mip 0 aligned size to change. It will create a copy dependency view instead. Fixes graphical errors and crashes (on flush) in various Unity games that use render-to-texture. * Move shared code to its own method.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/Texture.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/Texture.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/Texture.cs b/Ryujinx.Graphics.Gpu/Image/Texture.cs
index 4d7e31c5..6f720f4c 100644
--- a/Ryujinx.Graphics.Gpu/Image/Texture.cs
+++ b/Ryujinx.Graphics.Gpu/Image/Texture.cs
@@ -941,7 +941,7 @@ namespace Ryujinx.Graphics.Gpu.Image
return TextureMatchQuality.NoMatch;
}
- if (!TextureCompatibility.SizeMatches(Info, info, (flags & TextureSearchFlags.Strict) == 0))
+ if (!TextureCompatibility.SizeMatches(Info, info, (flags & TextureSearchFlags.Strict) == 0, FirstLevel))
{
return TextureMatchQuality.NoMatch;
}