mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Vulkan: Correct the max level to generate mipmap calculation
This commit is contained in:
parent
0179cb1811
commit
05429fc34f
1 changed files with 13 additions and 10 deletions
|
@ -630,15 +630,6 @@ 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) {
|
||||
// Boost the number of mipmaps.
|
||||
int maxPossibleMipmaps = log2i(std::min(gstate.getTextureWidth(0), gstate.getTextureHeight(0)));
|
||||
if (maxPossibleMipmaps > maxLevelToGenerate) {
|
||||
maxLevelToGenerate = maxPossibleMipmaps;
|
||||
dstFmt = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
}
|
||||
}
|
||||
|
||||
int scaleFactor = standardScaleFactor_;
|
||||
bool hardwareScaling = g_Config.bTexHardwareScaling && uploadCS_ != VK_NULL_HANDLE;
|
||||
|
@ -664,6 +655,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
|||
badMipSizes = false;
|
||||
}
|
||||
|
||||
|
||||
// Don't scale the PPGe texture.
|
||||
if (entry->addr > 0x05000000 && entry->addr < PSP_GetKernelMemoryEnd()) {
|
||||
scaleFactor = 1;
|
||||
|
@ -685,12 +677,23 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Support mip levels for upscaled images.
|
||||
// TODO: Support reading actual mip levels for upscaled images, instead of just generating them.
|
||||
// Probably can just remove this check?
|
||||
if (scaleFactor > 1) {
|
||||
maxLevel = 0;
|
||||
}
|
||||
|
||||
int maxPossibleMipmaps = log2i(std::min(w * scaleFactor, h * scaleFactor));
|
||||
|
||||
// TODO: Really should inspect the format capabilities.
|
||||
if (g_Config.iTexFiltering == TEX_FILTER_AUTO_MAX_QUALITY) {
|
||||
// Boost the number of mipmaps.
|
||||
if (maxPossibleMipmaps > maxLevelToGenerate) {
|
||||
dstFmt = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
}
|
||||
maxLevelToGenerate = maxPossibleMipmaps;
|
||||
}
|
||||
|
||||
// Any texture scaling is gonna move away from the original 16-bit format, if any.
|
||||
VkFormat actualFmt = scaleFactor > 1 ? VULKAN_8888_FORMAT : dstFmt;
|
||||
if (replaced.Valid()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue