diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-29 21:00:39 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-29 21:00:39 +0200 |
| commit | 02afec507622d2fcf705f9147de21f081f77aaa5 (patch) | |
| tree | bb0e5818f0de88eadffc35b51a479db54a1e48e1 /Source/Plugins/Plugin_VideoDX11/Src/PixelShaderCache.cpp | |
| parent | 77dae3496a45b8f885119fc65da93cb0699c0bb2 (diff) | |
Polish shader uid checking.
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX11/Src/PixelShaderCache.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/PixelShaderCache.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Plugins/Plugin_VideoDX11/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/PixelShaderCache.cpp index 9db0a53d13..0adf82fef9 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/PixelShaderCache.cpp @@ -29,6 +29,7 @@ namespace DX11 PixelShaderCache::PSCache PixelShaderCache::PixelShaders; const PixelShaderCache::PSCacheEntry* PixelShaderCache::last_entry; PixelShaderUid PixelShaderCache::last_uid; +UidChecker<PixelShaderUid,PixelShaderCode> PixelShaderCache::pixel_uid_checker; LinearDiskCache<PixelShaderUid, u8> g_ps_disk_cache; @@ -412,7 +413,8 @@ void PixelShaderCache::Clear() { for (PSCache::iterator iter = PixelShaders.begin(); iter != PixelShaders.end(); iter++) iter->second.Destroy(); - PixelShaders.clear(); + PixelShaders.clear(); + pixel_uid_checker.Invalidate(); last_entry = NULL; } @@ -450,6 +452,12 @@ bool PixelShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components) { PixelShaderUid uid; GetPixelShaderUid(uid, dstAlphaMode, API_D3D11, components); + if (g_ActiveConfig.bEnableShaderDebugging) + { + PixelShaderCode code; + GeneratePixelShaderCode(code, dstAlphaMode, API_D3D11, components); + pixel_uid_checker.AddToIndexAndCheck(code, uid, "Pixel", "p"); + } // Check if the shader is already set if (last_entry) |
