Fix missing data for new copy dependency textures with mismatching size (#6161)

This commit is contained in:
gdkchan 2024-01-22 17:42:26 -03:00 committed by GitHub
parent f241f88558
commit 4df22eb867
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -790,8 +790,12 @@ namespace Ryujinx.Graphics.Gpu.Image
texture = new Texture(_context, _physicalMemory, info, sizeInfo, range.Value, scaleMode); 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.InitializeGroup(true, true, new List<TextureIncompatibleOverlap>());
texture.InitializeData(false, false); texture.InitializeData(false, updateNewTexture);
overlap.SynchronizeMemory(); overlap.SynchronizeMemory();
overlap.CreateCopyDependency(texture, oInfo.FirstLayer, oInfo.FirstLevel, true); overlap.CreateCopyDependency(texture, oInfo.FirstLayer, oInfo.FirstLevel, true);