GPU: Fix negative mip levels with const workaround.

Might've crashed if it hit a negative level before.
This commit is contained in:
Unknown W. Brackets committed 2017-05-31 21:42:07 -07:00
1 parent b6375638f5
commit f66ffb9ffe
5 files changed
+10 -6

No files matched your search

+2 -1
View File
@@ -630,7 +630,8 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry, bool replaceIm
}
if (entry->vkTex) {
u8 level = (gstate.texlevel >> 20) & 0xF;
// NOTE: Since the level is not part of the cache key, we assume it never changes.
u8 level = std::max(0, gstate.getTexLevelOffset16() / 16);
bool fakeMipmap = IsFakeMipmapChange() && level > 0;
// Upload the texture data.
for (int i = 0; i <= maxLevel; i++) {