aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-01-22 17:42:26 -0300
committerGitHub <noreply@github.com>2024-01-22 17:42:26 -0300
commit4df22eb86707005821a5012421a76b308bcc1989 (patch)
treed2823810e52d5876194c049e8067f875c1d3fa01 /src
parentf241f88558b3fe90d76fc21123bd06b9e4c3d2da (diff)
Fix missing data for new copy dependency textures with mismatching size (#6161)1.1.1121
Diffstat (limited to 'src')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
index 6b92c0aa..5743c89c 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
@@ -790,8 +790,12 @@ namespace Ryujinx.Graphics.Gpu.Image
texture = new Texture(_context, _physicalMemory, info, sizeInfo, range.Value, scaleMode);
+ // If the new texture is larger than the existing one, we need to fill the remaining space with CPU data,
+ // otherwise we only need the data that is copied from the existing texture, without loading the CPU data.
+ bool updateNewTexture = texture.Width > overlap.Width || texture.Height > overlap.Height;
+
texture.InitializeGroup(true, true, new List<TextureIncompatibleOverlap>());
- texture.InitializeData(false, false);
+ texture.InitializeData(false, updateNewTexture);
overlap.SynchronizeMemory();
overlap.CreateCopyDependency(texture, oInfo.FirstLayer, oInfo.FirstLevel, true);