From 2295a55bd184fc84a94de015c3f679d1487cf1e1 Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Tue, 6 Oct 2026 16:06:17 +0300 Subject: [PATCH] [GPU] Give images first found without metadata the DCC metadata of a texture request Co-authored-by: Sekai <140012992+igettingit@users.noreply.github.com> --- src/SharpEmu.Libs/Gpu/Images/GuestImageCache.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/SharpEmu.Libs/Gpu/Images/GuestImageCache.cs b/src/SharpEmu.Libs/Gpu/Images/GuestImageCache.cs index 94728e9..8d50e0a 100644 --- a/src/SharpEmu.Libs/Gpu/Images/GuestImageCache.cs +++ b/src/SharpEmu.Libs/Gpu/Images/GuestImageCache.cs @@ -126,6 +126,17 @@ public sealed unsafe partial class GuestImageCache : IGuestImageCache, IGuestIma var found = LookUpImage(ref request, exactFormat); if (request.Role is ImageRole.Texture or ImageRole.StorageImage) { + if (request.Description.Metadata.Kind == MetadataKind.Dcc) + { + using var held = _lock.Hold(); + var image = _slots[found]; + if (image.Description.Metadata.Kind == MetadataKind.None) + { + image.Description.Metadata.Kind = MetadataKind.Dcc; + image.Description.Metadata.Range = request.Description.Metadata.Range; + } + } + ref readonly var description = ref _slots[found].Description; if (description.DccSliceSize is var sliceSize and not 0) {