diff options
| author | NanoByte011 <nanobyte011@hotmail.com> | 2014-12-25 00:34:22 -0700 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2015-01-23 03:31:54 +1300 |
| commit | 937844b9e339d1f6b819e90eeb9bde65f45e833f (patch) | |
| tree | 4226b4160379d52e030385ef0a811c5c7ce0c331 /Source/Core/VideoCommon/PixelShaderManager.cpp | |
| parent | 4984215971e0c03a16e40b0c1703840bfa2cdab8 (diff) | |
Initial port of zfreeze branch (3.5-1729)
Initial port of original zfreeze branch (3.5-1729) by neobrain into
most recent build of Dolphin.
Makes Rogue Squadron 2 very playable at full speed thanks to recent core
speedups made to Dolphin. Works on DirectX Video plugin only for now.
Enjoy! and Merry Xmas!!
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderManager.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index 0c6d4b73b3..b55147eb15 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -14,6 +14,8 @@ bool PixelShaderManager::s_bFogRangeAdjustChanged; bool PixelShaderManager::s_bViewPortChanged; +bool PixelShaderManager::s_bZSlopeChanged; +static float zslope[3]; std::array<int4,4> PixelShaderManager::s_tev_color; std::array<int4,4> PixelShaderManager::s_tev_konst_color; @@ -48,6 +50,7 @@ void PixelShaderManager::Dirty() SetDestAlpha(); SetZTextureBias(); SetViewportChanged(); + SetZSlopeChanged(0, 0, 1); SetIndTexScaleChanged(false); SetIndTexScaleChanged(true); SetIndMatrixChanged(0); @@ -112,6 +115,17 @@ void PixelShaderManager::SetConstants() dirty = true; s_bViewPortChanged = false; } + + if (s_bZSlopeChanged) + { + constants.zslope[0] = zslope[0]; + constants.zslope[1] = zslope[1]; + constants.zslope[2] = zslope[2]; + constants.zslope[3] = 0; + + dirty = true; + s_bZSlopeChanged = false; + } } void PixelShaderManager::SetTevColor(int index, int component, s32 value) @@ -168,6 +182,14 @@ void PixelShaderManager::SetViewportChanged() s_bFogRangeAdjustChanged = true; // TODO: Shouldn't be necessary with an accurate fog range adjust implementation } +void PixelShaderManager::SetZSlopeChanged(float dfdx, float dfdy, float f0) +{ + zslope[0] = dfdx; + zslope[1] = dfdy; + zslope[2] = f0; + s_bZSlopeChanged = true; +} + void PixelShaderManager::SetIndTexScaleChanged(bool high) { constants.indtexscale[high][0] = bpmem.texscale[high].ss0; |
