From d9f62d690a934b9be028296cd196b0e3e9939e4b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 13 Sep 2021 00:03:42 -0700 Subject: [PATCH] Vulkan: Expand 16-bit textures to generate mips. When using "Auto Max Quality", we can't use 16-bit formats. See #14804. --- GPU/Vulkan/TextureCacheVulkan.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index fadb043b22..35504f6d75 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -754,10 +754,11 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { VkFormat dstFmt = GetDestFormat(GETextureFormat(entry->format), gstate.getClutPaletteFormat()); // TODO: Really should inspect the format capabilities. - if (g_Config.iTexFiltering == TEX_FILTER_AUTO_MAX_QUALITY && dstFmt == VK_FORMAT_R8G8B8A8_UNORM) { + if (g_Config.iTexFiltering == TEX_FILTER_AUTO_MAX_QUALITY) { // Boost the number of mipmaps. int maxPossibleMipmaps = log2i(std::min(gstate.getTextureWidth(0), gstate.getTextureHeight(0))); maxLevelToGenerate = maxPossibleMipmaps; + dstFmt = VK_FORMAT_R8G8B8A8_UNORM; } int scaleFactor = standardScaleFactor_; @@ -1092,7 +1093,7 @@ void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePt decPitch = w * bpp; } - bool expand32 = !gstate_c.Supports(GPU_SUPPORTS_16BIT_FORMATS); + bool expand32 = !gstate_c.Supports(GPU_SUPPORTS_16BIT_FORMATS) || dstFmt == VK_FORMAT_R8G8B8A8_UNORM; DecodeTextureLevel((u8 *)pixelData, decPitch, tfmt, clutformat, texaddr, level, bufw, false, false, expand32); gpuStats.numTexturesDecoded++;