video_core: Add ETC2 texture compression format support

Adds comprehensive support for ETC2 compressed texture formats (ETC2_RGB,
ETC2_RGBA, ETC2_RGB_PTA) in both UNORM and SRGB variants. This addresses
rendering issues in games like Hogwarts Legacy that use these formats.

Changes:
- Add ETC2 texture format enums (TextureFormat::ETC2_RGB_SRGB,
  ETC2_RGBA_SRGB) and component types (SNORM_FORCE_FP16, UNORM_FORCE_FP16)
- Implement format lookup mappings for all ETC2 variants in
  format_lookup_table.cpp
- Add PixelFormat enum values and block size tables for ETC2 formats
- Integrate ETC2 support into Vulkan backend with proper VkFormat mappings
- Add IsOptimalEtc2Supported() device capability check
- Update texture cache to handle ETC2 format conversion when needed
- Add ETC2 format cases to PixelFormat formatter for logging
- Improve shader environment texture handle validation with graceful
  fallback for invalid handles

Fixes assertion failures for texture formats 90 and 99, enabling proper
rendering of ETC2 compressed textures using native Vulkan support.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-12-28 11:57:18 +10:00
parent 2028150ebf
commit 855a38ee97
10 changed files with 172 additions and 59 deletions

View File

@@ -87,6 +87,9 @@ enum class TextureFormat : u32 {
ASTC_2D_8X5 = 0x55,
ASTC_2D_10X5 = 0x56,
ASTC_2D_10X6 = 0x57,
// Additional formats found in games
ETC2_RGB_SRGB = 0x5a, // Format 90: ETC2 RGB with SRGB
ETC2_RGBA_SRGB = 0x63, // Format 99: ETC2 RGBA with SRGB
};
enum class TextureType : u32 {