Fix some regressions from r3b38295cbd08.

This commit is contained in:
NeoBrainX 2012-03-20 22:36:21 +01:00
parent 0861f524d4
commit 6202714efd
1 changed files with 13 additions and 5 deletions

View File

@ -172,7 +172,9 @@ void TextureCache::ClearRenderTargets()
TexCache::iterator TexCache::iterator
iter = textures.begin(), iter = textures.begin(),
tcend = textures.end(); tcend = textures.end();
for (; iter!=tcend; ++iter) for (; iter!=tcend; ++iter)
if (iter->second->type != TCET_EC_DYNAMIC)
iter->second->type = TCET_NORMAL; iter->second->type = TCET_NORMAL;
} }
@ -238,6 +240,9 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
// 2. a) For EFB copies, only the hash and the texture address need to match // 2. a) For EFB copies, only the hash and the texture address need to match
if (entry->IsEfbCopy() && tex_hash == entry->hash && address == entry->addr) if (entry->IsEfbCopy() && tex_hash == entry->hash && address == entry->addr)
{ {
if (entry->type != TCET_EC_VRAM)
entry->type = TCET_NORMAL;
// TODO: Print a warning if the format changes! In this case, we could reinterpret the internal texture object data to the new pixel format (similiar to what is already being done in Renderer::ReinterpretPixelFormat()) // TODO: Print a warning if the format changes! In this case, we could reinterpret the internal texture object data to the new pixel format (similiar to what is already being done in Renderer::ReinterpretPixelFormat())
goto return_entry; goto return_entry;
} }
@ -318,8 +323,8 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
entry->SetGeneralParameters(address, texture_size, full_format, entry->num_mipmaps); entry->SetGeneralParameters(address, texture_size, full_format, entry->num_mipmaps);
entry->SetDimensions(nativeW, nativeH, width, height); entry->SetDimensions(nativeW, nativeH, width, height);
entry->hash = tex_hash; entry->hash = tex_hash;
if (g_ActiveConfig.bCopyEFBToTexture) entry->type = TCET_NORMAL; if (entry->IsEfbCopy() && !g_ActiveConfig.bCopyEFBToTexture) entry->type = TCET_EC_DYNAMIC;
else if (entry->IsEfbCopy()) entry->type = TCET_EC_DYNAMIC; else entry->type = TCET_NORMAL;
// load texture // load texture
entry->Load(width, height, expandedWidth, 0, (texLevels == 0)); entry->Load(width, height, expandedWidth, 0, (texLevels == 0));
@ -646,10 +651,13 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
{ {
if ((entry->type == TCET_EC_VRAM && entry->virtual_width == scaled_tex_w && entry->virtual_height == scaled_tex_h) if ((entry->type == TCET_EC_VRAM && entry->virtual_width == scaled_tex_w && entry->virtual_height == scaled_tex_h)
|| (entry->type == TCET_EC_DYNAMIC && entry->native_width == tex_w && entry->native_height == tex_h)) || (entry->type == TCET_EC_DYNAMIC && entry->native_width == tex_w && entry->native_height == tex_h))
{
if (entry->type == TCET_EC_DYNAMIC)
{ {
scaled_tex_w = tex_w; scaled_tex_w = tex_w;
scaled_tex_h = tex_h; scaled_tex_h = tex_h;
} }
}
else else
{ {
// remove it and recreate it as a render target // remove it and recreate it as a render target