mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-06 04:33:49 +01:00
Fix crash in LocoRoco with D3D11 when hitting a spiky (a broken texture gets created with too many mipmaps for its size)
This commit is contained in:
1 parent
94cb35f65b
commit
2ebba56758
1 file changed
+8
-2
@@ -474,9 +474,15 @@ void TextureCacheD3D11::BuildTexture(TexCacheEntry *const entry, bool replaceIma
|
||||
break;
|
||||
}
|
||||
|
||||
// If size reaches 1, stop, and override maxlevel.
|
||||
int tw = gstate.getTextureWidth(i);
|
||||
int th = gstate.getTextureHeight(i);
|
||||
if (tw == 1 || th == 1) {
|
||||
maxLevel = i;
|
||||
break;
|
||||
}
|
||||
|
||||
if (i > 0 && gstate_c.Supports(GPU_SUPPORTS_TEXTURE_LOD_CONTROL)) {
|
||||
int tw = gstate.getTextureWidth(i);
|
||||
int th = gstate.getTextureHeight(i);
|
||||
if (tw != 1 && tw != (gstate.getTextureWidth(i - 1) >> 1))
|
||||
badMipSizes = true;
|
||||
else if (th != 1 && th != (gstate.getTextureHeight(i - 1) >> 1))
|
||||
|
||||
Reference in new issue
Block a user