mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Merge pull request #18083 from hrydgard/tex-loader-safety
Add some texture loading safety checks
This commit is contained in:
commit
fa9a13a99c
@ -2918,6 +2918,7 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
|
||||
}
|
||||
|
||||
if (plan.isVideo || plan.depth != 1 || plan.decodeToClut8) {
|
||||
plan.levelsToLoad = 1;
|
||||
plan.maxPossibleLevels = 1;
|
||||
} else {
|
||||
plan.maxPossibleLevels = log2i(std::min(plan.createW, plan.createH)) + 1;
|
||||
|
@ -442,6 +442,8 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
||||
dstFmt = VULKAN_CLUT8_FORMAT;
|
||||
}
|
||||
|
||||
_dbg_assert_(plan.levelsToLoad <= plan.maxPossibleLevels);
|
||||
|
||||
// We don't generate mipmaps for 512x512 textures because they're almost exclusively used for menu backgrounds
|
||||
// and similar, which don't really need it.
|
||||
// Also, if using replacements, check that we really can generate mips for this format - that's not possible for compressed ones.
|
||||
|
Loading…
Reference in New Issue
Block a user