Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TextureCacheBase: Delete textures completely instead of just invalida…
…ting them in ClearRenderTargets.

That's what would've been done in the next TCB::Load() call, anyway.
Fixes issue 5742.

Additionally, change efb copies to specify 1 as the number of mipmaps because that makes more sense than anything else.
  • Loading branch information
neobrain committed Dec 17, 2012
1 parent 4c7b63c commit 0811311
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/Core/VideoCommon/Src/TextureCacheBase.cpp
Expand Up @@ -205,8 +205,11 @@ void TextureCache::ClearRenderTargets()
tcend = textures.end();

for (; iter!=tcend; ++iter)
if (iter->second->type != TCET_EC_DYNAMIC)
iter->second->type = TCET_NORMAL;
if (iter->second->type == TCET_EC_VRAM)
{
delete iter->second;
textures.erase(iter++);
}
}

bool TextureCache::CheckForCustomTextureLODs(u64 tex_hash, int texformat, unsigned int levels)
Expand Down Expand Up @@ -782,7 +785,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
textures[dstAddr] = entry = g_texture_cache->CreateRenderTargetTexture(scaled_tex_w, scaled_tex_h);

// TODO: Using the wrong dstFormat, dumb...
entry->SetGeneralParameters(dstAddr, 0, dstFormat, 0);
entry->SetGeneralParameters(dstAddr, 0, dstFormat, 1);
entry->SetDimensions(tex_w, tex_h, scaled_tex_w, scaled_tex_h);
entry->SetHashes(TEXHASH_INVALID);
entry->type = TCET_EC_VRAM;
Expand Down

0 comments on commit 0811311

Please sign in to comment.