From ada52eb61c8099085f81ece178c0e203db6f7b6d Mon Sep 17 00:00:00 2001 From: Jakob Linke <36006+schuay@users.noreply.github.com> Date: Fri, 22 May 2026 15:57:12 +0200 Subject: [PATCH] Suppress Invalid-texture-format log spam from uninitialized pool slots UpdateFromPool iterates the full texture pool (sized by the guest's MaximumId), which can exceed the slot range the guest has actually populated. The trailing slots hold whatever was in guest memory at allocation time; for pools filled with a poison byte (e.g. 0x5A) every descriptor word is identical, the format lookup misses, and the existing error log fires once per slot. Skip the log when all eight descriptor words are bitwise equal. No real descriptor has that shape, so this is a structural uninitialized-memory test rather than a behaviour change; the lookup still falls back to FormatInfo.Default as before. --- src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs index d9fe02f8d..6c7c676bf 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs @@ -529,6 +529,19 @@ namespace Ryujinx.Graphics.Gpu.Image } } + private static bool IsUninitializedDescriptor(in TextureDescriptor descriptor) + { + uint w = descriptor.Word0; + + return descriptor.Word1 == w + && descriptor.Word2 == w + && descriptor.Word3 == w + && descriptor.Word4 == w + && descriptor.Word5 == w + && descriptor.Word6 == w + && descriptor.Word7 == w; + } + /// /// Gets texture information from a texture descriptor. /// @@ -586,7 +599,7 @@ namespace Ryujinx.Graphics.Gpu.Image if (!FormatTable.TryGetTextureFormat(format, srgb, out FormatInfo formatInfo)) { - if (gpuVa != 0 && format != 0) + if (gpuVa != 0 && format != 0 && !IsUninitializedDescriptor(descriptor)) { Logger.Error?.Print(LogClass.Gpu, $"Invalid texture format 0x{format:X} (sRGB: {srgb})."); }