mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Replacement: Detect OOM even with replacements.
Also allow saving video textures if so configured.
This commit is contained in:
parent
1033fa6cd7
commit
c5fbb400de
@ -2380,7 +2380,7 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
|
||||
}
|
||||
}
|
||||
|
||||
if (plan.isVideo || isPPGETexture) {
|
||||
if (isPPGETexture) {
|
||||
plan.replaced = &replacer_.FindNone();
|
||||
plan.replaceValid = false;
|
||||
} else {
|
||||
|
@ -508,7 +508,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
||||
image->SetTag(texName);
|
||||
|
||||
bool allocSuccess = image->CreateDirect(cmdInit, plan.createW, plan.createH, plan.depth, plan.levelsToCreate, actualFmt, imageLayout, usage, mapping);
|
||||
if (!allocSuccess && !lowMemoryMode_ && !replacer_.Enabled()) {
|
||||
if (!allocSuccess && !lowMemoryMode_) {
|
||||
WARN_LOG_REPORT(G3D, "Texture cache ran out of GPU memory; switching to low memory mode");
|
||||
lowMemoryMode_ = true;
|
||||
decimationCounter_ = 0;
|
||||
@ -628,7 +628,8 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
||||
entry->vkTex->UploadMip(cmdInit, i, mipWidth, mipHeight, 0, texBuf, bufferOffset, stride / bpp);
|
||||
VK_PROFILE_END(vulkan, cmdInit, VK_PIPELINE_STAGE_TRANSFER_BIT);
|
||||
}
|
||||
if (replacer_.Enabled() && plan.replaced->IsInvalid()) {
|
||||
// Format might be wrong in lowMemoryMode_, so don't save.
|
||||
if (replacer_.Enabled() && plan.replaced->IsInvalid() && !lowMemoryMode_) {
|
||||
// When hardware texture scaling is enabled, this saves the original.
|
||||
int w = dataScaled ? mipWidth : mipUnscaledWidth;
|
||||
int h = dataScaled ? mipHeight : mipUnscaledHeight;
|
||||
|
Loading…
Reference in New Issue
Block a user