summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-09-13 17:46:33 +0000
committerhrydgard <hrydgard@gmail.com>2009-09-13 17:46:33 +0000
commita7c70ddb6684aee4dfcbc7ce43f07447fac7761d (patch)
tree86a9cf8ffb27cb03733dfa656ee2647d7f93fb22 /Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp
parent5911abc60010d65d9ed9f18b7637d89cf8fe541b (diff)
D3D: Eliminate black borders, add 4:3 and 16:9 settings, and the widescreen hack. Unfortunately this temporarily breaks MSAA (in d3d only) until I have time to fix it.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4263 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp
index 088f22faa4..5b6fa691b4 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp
@@ -63,19 +63,24 @@ void SetPSConstant4fv(int const_number, const float *f)
void PixelShaderCache::Init()
{
- //memset(lastPSconstants,0xFF,(C_COLORMATRIX+16)*4*sizeof(float)); // why does this not work
- //memset(lastPSconstants,0xFF,sizeof(lastPSconstants));
- for( int i=0;i<(C_COLORMATRIX+16)*4;i++)
- lastPSconstants[i/4][i%4] = -100000000.0f;
- memset(&last_pixel_shader_uid,0xFF,sizeof(last_pixel_shader_uid));
+ Clear();
}
-void PixelShaderCache::Shutdown()
+void PixelShaderCache::Clear()
{
PSCache::iterator iter = PixelShaders.begin();
for (; iter != PixelShaders.end(); iter++)
iter->second.Destroy();
PixelShaders.clear();
+
+ for (int i = 0; i < (C_COLORMATRIX + 16) * 4; i++)
+ lastPSconstants[i/4][i%4] = -100000000.0f;
+ memset(&last_pixel_shader_uid, 0xFF, sizeof(last_pixel_shader_uid));
+}
+
+void PixelShaderCache::Shutdown()
+{
+ Clear();
}
bool PixelShaderCache::SetShader(bool dstAlpha)
@@ -86,7 +91,8 @@ bool PixelShaderCache::SetShader(bool dstAlpha)
GetPixelShaderId(uid, PixelShaderManager::GetTextureMask(), dstAlpha);
if (uid == last_pixel_shader_uid)
{
- if (PixelShaders[uid].shader)
+ PSCache::const_iterator iter = PixelShaders.find(uid);
+ if (iter != PixelShaders.end() && iter->second.shader)
return true;
else
return false;
@@ -129,7 +135,6 @@ bool PixelShaderCache::SetShader(bool dstAlpha)
INCSTAT(stats.numPixelShadersCreated);
SETSTAT(stats.numPixelShadersAlive, (int)PixelShaders.size());
-
if (shader)
{
D3D::dev->SetPixelShader(shader);