TexCache: Allow valid bufw sizes.

These don't cause crashes anymore.
This commit is contained in:
Unknown W. Brackets 2022-09-10 20:15:43 -07:00
parent 6c6d817ce7
commit 3242bb8d66

View file

@ -2271,12 +2271,6 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
// For the estimate, we assume cluts always point to 8888 for simplicity.
cacheSizeEstimate_ += EstimateTexMemoryUsage(entry);
if ((entry->bufw == 0 || (gstate.texbufwidth[0] & 0xf800) != 0) && entry->addr >= PSP_GetKernelMemoryEnd()) {
ERROR_LOG_REPORT(G3D, "Texture with unexpected bufw (full=%d)", gstate.texbufwidth[0] & 0xffff);
// Proceeding here can cause a crash.
return false;
}
plan.badMipSizes = false;
// maxLevel here is the max level to upload. Not the count.
plan.levelsToLoad = entry->maxLevel + 1;