Browse Source

Revert "[maxwell] Logging for HDR wrong convertions into depth formats"

This reverts commit 66c26e39fe.
true-eds-graphics
CamilleLaVey 4 weeks ago
parent
commit
dcc95778fd
  1. 13
      src/video_core/texture_cache/format_lookup_table.cpp
  2. 53
      src/video_core/texture_cache/image_info.cpp

13
src/video_core/texture_cache/format_lookup_table.cpp

@ -1,6 +1,3 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -248,13 +245,9 @@ PixelFormat PixelFormatFromTextureInfo(TextureFormat format, ComponentType red,
case Hash(TextureFormat::ASTC_2D_6X5, UNORM, SRGB):
return PixelFormat::ASTC_2D_6X5_SRGB;
}
const u32 hash_value = Hash(format, red, green, blue, alpha, is_srgb);
LOG_ERROR(Render_Vulkan,
"Unmapped texture format: format=0x{:02X} ({}) srgb={} "
"components={{r={} g={} b={} a={}}} hash=0x{:08X}",
static_cast<u32>(format), static_cast<int>(format), is_srgb,
static_cast<int>(red), static_cast<int>(green),
static_cast<int>(blue), static_cast<int>(alpha), hash_value);
UNIMPLEMENTED_MSG("texture format={} srgb={} components={{{} {} {} {}}}",
static_cast<int>(format), is_srgb, static_cast<int>(red),
static_cast<int>(green), static_cast<int>(blue), static_cast<int>(alpha));
return PixelFormat::A8B8G8R8_UNORM;
}

53
src/video_core/texture_cache/image_info.cpp

@ -31,62 +31,9 @@ constexpr u32 DownscaleHeightThreshold = 512;
ImageInfo::ImageInfo(const TICEntry& config) noexcept {
forced_flushed = config.IsPitchLinear() && !Settings::values.use_reactive_flushing.GetValue();
dma_downloaded = forced_flushed;
// Validate component types match format expectations
const auto tex_format = config.format;
const bool is_depth_stencil =
tex_format == Tegra::Texture::TextureFormat::Z24S8 ||
tex_format == Tegra::Texture::TextureFormat::S8Z24 ||
tex_format == Tegra::Texture::TextureFormat::Z32 ||
tex_format == Tegra::Texture::TextureFormat::Z16 ||
tex_format == Tegra::Texture::TextureFormat::X8Z24 ||
tex_format == Tegra::Texture::TextureFormat::Z32_X24S8;
const bool is_hdr_float =
tex_format == Tegra::Texture::TextureFormat::B10G11R11 ||
tex_format == Tegra::Texture::TextureFormat::E5B9G9R9;
// Sanity check: HDR formats should use FLOAT components, depth should use UNORM/UINT
if (is_hdr_float && config.r_type != Tegra::Texture::ComponentType::FLOAT) {
LOG_WARNING(Render_Vulkan,
"HDR format 0x{:02X} has non-FLOAT components (r={} g={} b={} a={}), "
"possible register corruption",
static_cast<u32>(tex_format.Value()),
static_cast<u32>(config.r_type.Value()), static_cast<u32>(config.g_type.Value()),
static_cast<u32>(config.b_type.Value()), static_cast<u32>(config.a_type.Value()));
}
format = PixelFormatFromTextureInfo(config.format, config.r_type, config.g_type, config.b_type,
config.a_type, config.srgb_conversion);
// Validate final format makes sense
const bool detected_as_depth =
format == PixelFormat::D32_FLOAT || format == PixelFormat::D16_UNORM ||
format == PixelFormat::X8_D24_UNORM || format == PixelFormat::S8_UINT ||
format == PixelFormat::S8_UINT_D24_UNORM || format == PixelFormat::D24_UNORM_S8_UINT ||
format == PixelFormat::D32_FLOAT_S8_UINT;
if (is_hdr_float && detected_as_depth) {
LOG_ERROR(Render_Vulkan,
"Format mismatch: HDR format 0x{:02X} mapped to depth/stencil {}. "
"TIC components: r={} g={} b={} a={} srgb={}",
static_cast<u32>(tex_format.Value()), format,
static_cast<u32>(config.r_type.Value()), static_cast<u32>(config.g_type.Value()),
static_cast<u32>(config.b_type.Value()), static_cast<u32>(config.a_type.Value()),
config.srgb_conversion);
}
if (is_depth_stencil && !detected_as_depth &&
format != PixelFormat::A8B8G8R8_UNORM) { // Allow fallback
LOG_ERROR(Render_Vulkan,
"Format mismatch: Depth/stencil format 0x{:02X} mapped to color {}. "
"TIC components: r={} g={} b={} a={} srgb={}",
static_cast<u32>(tex_format.Value()), format,
static_cast<u32>(config.r_type.Value()), static_cast<u32>(config.g_type.Value()),
static_cast<u32>(config.b_type.Value()), static_cast<u32>(config.a_type.Value()),
config.srgb_conversion);
}
num_samples = NumSamples(config.msaa_mode);
resources.levels = config.max_mip_level + 1;
if (config.IsPitchLinear()) {

Loading…
Cancel
Save