From f7e15ec7f27108d852b6a9711d892196abdba579 Mon Sep 17 00:00:00 2001 From: rice1964 Date: Wed, 16 Sep 2009 05:31:19 +0000 Subject: [PATCH] Fix some shader problems caused by my previous commits to reduce API calls (back screen after a while in Zelda WW intro, maybe also in other games). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4283 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp | 2 +- Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp index 5b6fa691b4..8833ba15b0 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp @@ -89,7 +89,7 @@ bool PixelShaderCache::SetShader(bool dstAlpha) PIXELSHADERUID uid; GetPixelShaderId(uid, PixelShaderManager::GetTextureMask(), dstAlpha); - if (uid == last_pixel_shader_uid) + if (uid == last_pixel_shader_uid && PixelShaders[uid].frameCount == frameCount) { PSCache::const_iterator iter = PixelShaders.find(uid); if (iter != PixelShaders.end() && iter->second.shader) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp index d414d6c371..24ed1a3fe0 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp @@ -120,7 +120,7 @@ bool VertexShaderCache::SetShader(u32 components) VERTEXSHADERUID uid; GetVertexShaderId(uid, components); - if (uid == last_vertex_shader_uid) + if (uid == last_vertex_shader_uid && vshaders[uid].frameCount == frameCount) { if (vshaders[uid].shader) return true; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp index ff12edcac2..14273ee66c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp @@ -169,7 +169,7 @@ FRAGMENTSHADER* PixelShaderCache::GetShader(bool dstAlphaEnable) PIXELSHADERUID uid; u32 dstAlpha = dstAlphaEnable ? 1 : 0; GetPixelShaderId(uid, PixelShaderManager::GetTextureMask(), dstAlpha); - if (uid == last_pixel_shader_uid) + if (uid == last_pixel_shader_uid && pshaders[uid].frameCount == frameCount) { return pShaderLast; } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp index 84e7a14409..defa2ca440 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp @@ -117,7 +117,7 @@ VERTEXSHADER* VertexShaderCache::GetShader(u32 components) VERTEXSHADERUID uid; GetVertexShaderId(uid, components); - if (uid == last_vertex_shader_uid) + if (uid == last_vertex_shader_uid && vshaders[uid].frameCount == frameCount) { return pShaderLast; }