From 966ff353eee57cf95bc47fb0149e60cea7b78ce4 Mon Sep 17 00:00:00 2001 From: Collecting Date: Wed, 7 Jan 2026 22:06:11 +0000 Subject: [PATCH] revert 750af88ed9a9bfbd64ebd0c551a57e007382b69d revert fix(video): handle invalid texture format in format lookup table Return default pixel format for uninitialized texture descriptors (format=0, components=0) instead of asserting. Prevents crashes when texture cache encounters uninitialized texture data. Fixes assertion failures in format_lookup_table.cpp:250. Signed-off-by: Zephyron --- src/video_core/texture_cache/format_lookup_table.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp index e6e7e1aa6..b5b140f16 100644 --- a/src/video_core/texture_cache/format_lookup_table.cpp +++ b/src/video_core/texture_cache/format_lookup_table.cpp @@ -1,5 +1,4 @@ // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project -// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/common_types.h" @@ -44,14 +43,6 @@ constexpr u32 Hash(TextureFormat format, ComponentType component, bool is_srgb = PixelFormat PixelFormatFromTextureInfo(TextureFormat format, ComponentType red, ComponentType green, ComponentType blue, ComponentType alpha, bool is_srgb) noexcept { - // Handle invalid/uninitialized texture format (0) with zero components - // This can occur when texture descriptors are not yet initialized - if (static_cast(format) == 0 && static_cast(red) == 0 && - static_cast(green) == 0 && static_cast(blue) == 0 && - static_cast(alpha) == 0) { - return PixelFormat::A8B8G8R8_UNORM; - } - switch (Hash(format, red, green, blue, alpha, is_srgb)) { case Hash(TextureFormat::A8B8G8R8, UNORM): return PixelFormat::A8B8G8R8_UNORM;