mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Fix error handling on texture creation failure
This commit is contained in:
parent
773bbbd648
commit
43a2af46ee
@ -1298,7 +1298,7 @@ Texture *VKContext::CreateTexture(const TextureDesc &desc) {
|
||||
return tex;
|
||||
} else {
|
||||
ERROR_LOG(G3D, "Failed to create texture");
|
||||
delete tex;
|
||||
tex->Release();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -194,6 +194,10 @@ Draw::Texture *ManagedTexture::GetTexture() {
|
||||
}
|
||||
// Image load is done, texture creation is not.
|
||||
texture_ = CreateTextureFromTempImage(draw_, pendingImage_, generateMips_, filename_.c_str());
|
||||
if (!texture_) {
|
||||
// Failed to create the texture for whatever reason, like dimensions. Don't retry next time.
|
||||
state_ = LoadState::FAILED;
|
||||
}
|
||||
pendingImage_.Free();
|
||||
}
|
||||
return texture_;
|
||||
|
Loading…
Reference in New Issue
Block a user