VK: Only autogenerate mipmaps for R8G8B8A8 format textures.

Quickfix for bug with Auto High Quality texture filtering.

Fixes #14804 (good enough for now at least).
This commit is contained in:
Henrik Rydgård 2021-09-07 23:41:03 +02:00
parent f83cf9fd0d
commit e2b0137400

View file

@ -751,15 +751,15 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
// such as when using replacement textures - but let's keep the same amount of levels.
int maxLevelToGenerate = maxLevel;
if (g_Config.iTexFiltering == TEX_FILTER_AUTO_MAX_QUALITY) {
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) {
// Boost the number of mipmaps.
int maxPossibleMipmaps = log2i(std::min(gstate.getTextureWidth(0), gstate.getTextureHeight(0)));
maxLevelToGenerate = maxPossibleMipmaps;
}
// If GLES3 is available, we can preallocate the storage, which makes texture loading more efficient.
VkFormat dstFmt = GetDestFormat(GETextureFormat(entry->format), gstate.getClutPaletteFormat());
int scaleFactor = standardScaleFactor_;
if (scaleFactor > maxScaleFactor_)
scaleFactor = maxScaleFactor_;