Merge pull request #18698 from hrydgard/beta-crash-fixes

Beta crash fixes 1
This commit is contained in:
Henrik Rydgård 2024-01-15 11:57:41 +01:00 committed by GitHub
commit 15db280358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 7 deletions

View File

@ -535,7 +535,7 @@ void VulkanRenderManager::ReleaseCompileQueue() {
}
void VulkanRenderManager::ThreadFunc() {
SetCurrentThreadName("RenderMan");
SetCurrentThreadName("VulkanRenderMan");
while (true) {
_dbg_assert_(useRenderThread_);

View File

@ -35,11 +35,13 @@ public:
ERROR_LOG(IO, "Failed to read file '%s'", filename_.c_str());
filename_.clear();
*state_ = ManagedTexture::LoadState::FAILED;
waitable_->Notify();
return;
}
if (!tempImage_->LoadTextureLevels(buffer, fileSize, type_)) {
*state_ = ManagedTexture::LoadState::FAILED;
waitable_->Notify();
return;
}
delete[] buffer;

View File

@ -127,14 +127,17 @@ bool GameDB::GetGameInfos(std::string_view id, std::vector<GameDBInfo> *infos) {
}
for (auto &line : lines_) {
for (auto serial : line.serials) {
for (auto &serial : line.serials) {
// Ignore version and stuff for now
if (IDMatches(id, serial)) {
GameDBInfo info;
if (1 != sscanf(line.crc.data(), "%08x", &info.crc)) {
// zero-terminate before sscanf
std::string crc(line.crc);
if (1 != sscanf(crc.c_str(), "%08x", &info.crc)) {
continue;
}
if (1 != sscanf(line.size.data(), "%llu", (long long *)&info.size)) {
std::string size(line.size);
if (1 != sscanf(size.c_str(), "%llu", (long long *)&info.size)) {
continue;
}
info.title = line.title;
@ -143,5 +146,6 @@ bool GameDB::GetGameInfos(std::string_view id, std::vector<GameDBInfo> *infos) {
}
}
}
return !infos->empty();
}

View File

@ -1530,7 +1530,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
if (invalid_) {
// Loading, or after shutdown?
if (loadingTextView_->GetVisibility() == UI::V_VISIBLE)
if (loadingTextView_ && loadingTextView_->GetVisibility() == UI::V_VISIBLE)
loadingTextView_->SetText(PSP_GetLoading());
// It's possible this might be set outside PSP_RunLoopFor().

View File

@ -343,7 +343,7 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
// Let's check the CRC in the game database, looking up the ID and also matching the crc.
std::vector<GameDBInfo> dbInfos;
if (tvVerified_ && g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
if (tvVerified_ && !info->id_version.empty() && g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
bool found = false;
for (auto &dbInfo : dbInfos) {
if (dbInfo.crc == crcVal) {
@ -368,7 +368,7 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
GameDBInfo dbInfo;
if (tvVerified_) {
std::vector<GameDBInfo> dbInfos;
if (!g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
if (!info->id_version.empty() && !g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
// tvVerified_->SetText(ga->T("Game ID unknown - not in the ReDump database"));
// tvVerified_->SetVisibility(UI::V_VISIBLE);
// tvVerified_->SetLevel(NoticeLevel::WARN);