Invalidate texture cache when the STC or native mipmaps options are changed.

Fixes minor graphical glitches in these cases.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6677 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX 2010-12-28 12:46:00 +00:00
parent 9bf2705c2d
commit 7de6773483
3 changed files with 19 additions and 4 deletions

View File

@ -950,6 +950,11 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
DLCache::ProgressiveCleanup();
TextureCache::Cleanup();
// reload textures if these settings changed
if (g_Config.bSafeTextureCache != g_ActiveConfig.bSafeTextureCache ||
g_Config.bUseNativeMips != g_ActiveConfig.bUseNativeMips)
TextureCache::Invalidate(false);
// Enable any configuration changes
UpdateActiveConfig();
const bool WindowResized = CheckForResize();

View File

@ -870,7 +870,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
{
if (bpmem.blendmode.logicopenable && !forceUpdate)
return;
if (bpmem.blendmode.subtract && bpmem.blendmode.blendenable)
{
D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, true);
@ -1159,6 +1159,11 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
DLCache::ProgressiveCleanup();
TextureCache::Cleanup();
// reload textures if these settings changed
if (g_Config.bSafeTextureCache != g_ActiveConfig.bSafeTextureCache ||
g_Config.bUseNativeMips != g_ActiveConfig.bUseNativeMips)
TextureCache::Invalidate(false);
// Enable any configuration changes
UpdateActiveConfig();
const bool WindowResized = CheckForResize();

View File

@ -1350,11 +1350,16 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
GL_REPORT_ERRORD();
g_Config.iSaveTargetId = 0;
bool last_copy_efb_to_Texture = g_ActiveConfig.bCopyEFBToTexture;
UpdateActiveConfig();
if (last_copy_efb_to_Texture != g_ActiveConfig.bCopyEFBToTexture)
// reload textures if these settings changed
if (g_Config.bSafeTextureCache != g_ActiveConfig.bSafeTextureCache ||
g_Config.bUseNativeMips != g_ActiveConfig.bUseNativeMips)
TextureCache::Invalidate(false);
if (g_Config.bCopyEFBToTexture != g_ActiveConfig.bCopyEFBToTexture)
TextureCache::ClearRenderTargets();
UpdateActiveConfig();
// For testing zbuffer targets.
// Renderer::SetZBufferRender();
// SaveTexture("tex.tga", GL_TEXTURE_RECTANGLE_ARB, s_FakeZTarget,