Latte: Fix infinite loop in special state clearAsDepth() (#209)

This broke while refactoring code for the 2.0 release. Resolves Tokyo Mirage Session and Pokken freezing on boot. Probably also affects some other games

Also updated .gitignore
This commit is contained in:
Exzap 2022-09-08 17:33:31 +02:00 committed by GitHub
parent f032088902
commit 1e851fe7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 23 deletions

1
.gitignore vendored
View File

@ -32,6 +32,7 @@ bin/mlc01/*
bin/settings.xml bin/settings.xml
bin/title_list_cache.xml bin/title_list_cache.xml
bin/debugger/* bin/debugger/*
bin/sdcard/*
!bin/shaderCache/info.txt !bin/shaderCache/info.txt
bin/shaderCache/* bin/shaderCache/*

View File

@ -551,8 +551,11 @@ void LatteDraw_handleSpecialState8_clearAsDepth()
while (true) while (true)
{ {
LatteTextureView* view = LatteTC_LookupTextureByData(depthBufferPhysMem, depthBufferWidth, depthBufferHeight, depthBufferPitch, 0, 1, sliceIndex, 1, &searchIndex); LatteTextureView* view = LatteTC_LookupTextureByData(depthBufferPhysMem, depthBufferWidth, depthBufferHeight, depthBufferPitch, 0, 1, sliceIndex, 1, &searchIndex);
if (view != nullptr) if (!view)
{ {
// should we clear in RAM instead?
break;
}
sint32 effectiveClearWidth = view->baseTexture->width; sint32 effectiveClearWidth = view->baseTexture->width;
sint32 effectiveClearHeight = view->baseTexture->height; sint32 effectiveClearHeight = view->baseTexture->height;
LatteTexture_scaleToEffectiveSize(view->baseTexture, &effectiveClearWidth, &effectiveClearHeight, 0); LatteTexture_scaleToEffectiveSize(view->baseTexture, &effectiveClearWidth, &effectiveClearHeight, 0);
@ -581,7 +584,6 @@ void LatteDraw_handleSpecialState8_clearAsDepth()
} }
} }
} }
}
void LatteDrawGL_doDraw(_INDEX_TYPE indexType, uint32 baseVertex, uint32 baseInstance, uint32 instanceCount, uint32 count) void LatteDrawGL_doDraw(_INDEX_TYPE indexType, uint32 baseVertex, uint32 baseInstance, uint32 instanceCount, uint32 count)
{ {