summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderManager.cpp
diff options
context:
space:
mode:
authorNanoByte011 <nanobyte011@hotmail.com>2014-12-26 01:25:24 -0700
committerScott Mansell <phiren@gmail.com>2015-01-23 03:32:31 +1300
commit613781c7650d3cbd494a212eacdff10ea5140894 (patch)
tree78b2c927de7bd2829ee24e3ec4d31c64bc891ce0 /Source/Core/VideoCommon/PixelShaderManager.cpp
parent937844b9e339d1f6b819e90eeb9bde65f45e833f (diff)
Cleanup and refactor of zfreeze port
Based on the feedback from pull request #1767 I have put in most of degasus's suggestions in here now. I think we have a real winner here as moving the code to VertexManagerBase for a function has allowed OGL to utilize zfreeze now :) Correct use of the vertex pointer has also corrected most of the issue found in pull request #1767 that JMC47 stated. Which also for me now has Mario Tennis working with no polygon spikes on the characters anymore! Shadows are still an issue and probably in the other games with shadow problems. Rebel Strike also seems better but random skybox glitches can show up.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderManager.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp
index b55147eb15..d0004a0921 100644
--- a/Source/Core/VideoCommon/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/PixelShaderManager.cpp
@@ -14,8 +14,6 @@
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;
@@ -50,7 +48,7 @@ void PixelShaderManager::Dirty()
SetDestAlpha();
SetZTextureBias();
SetViewportChanged();
- SetZSlopeChanged(0, 0, 1);
+ SetZSlope(0, 0, 1);
SetIndTexScaleChanged(false);
SetIndTexScaleChanged(true);
SetIndMatrixChanged(0);
@@ -115,17 +113,6 @@ 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)
@@ -182,12 +169,13 @@ 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)
+void PixelShaderManager::SetZSlope(float dfdx, float dfdy, float f0)
{
- zslope[0] = dfdx;
- zslope[1] = dfdy;
- zslope[2] = f0;
- s_bZSlopeChanged = true;
+ constants.zslope[0] = dfdx;
+ constants.zslope[1] = dfdy;
+ constants.zslope[2] = f0;
+ constants.zslope[3] = 0;
+ dirty = true;
}
void PixelShaderManager::SetIndTexScaleChanged(bool high)