summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/VertexShaderManager.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2011-12-08 03:20:31 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2011-12-08 03:20:31 -0600
commitcecc3c3873c6aaabea514b3a5eff380e5a32856f (patch)
tree30b8de4c172ee25353e188e0e238d49d28ea67f8 /Source/Core/VideoCommon/Src/VertexShaderManager.cpp
parent1201988fe4e94720f32f2165ee03d5debf957cd7 (diff)
Bit of cleanup. Clean up my massive hack in the ShaderManagerFiles. Almost feature parity with Nvidia CG now I think. Just need to do Alpha test with Dual source blending now.
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/VertexShaderManager.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp
index 8fd53d128d..2b962c5a6b 100644
--- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp
@@ -173,7 +173,9 @@ void VertexShaderManager::Dirty()
// TODO: A cleaner way to control the matricies without making a mess in the parameters field
void VertexShaderManager::SetConstants()
{
- if (nTransformMatricesChanged[0] >= 0 || g_ActiveConfig.bUseGLSL)
+ if (g_ActiveConfig.bUseGLSL)
+ Dirty();
+ if (nTransformMatricesChanged[0] >= 0)
{
int startn = nTransformMatricesChanged[0] / 4;
int endn = (nTransformMatricesChanged[1] + 3) / 4;
@@ -181,7 +183,7 @@ void VertexShaderManager::SetConstants()
SetMultiVSConstant4fv(C_TRANSFORMMATRICES + startn, endn - startn, pstart);
nTransformMatricesChanged[0] = nTransformMatricesChanged[1] = -1;
}
- if (nNormalMatricesChanged[0] >= 0 || g_ActiveConfig.bUseGLSL)
+ if (nNormalMatricesChanged[0] >= 0)
{
int startn = nNormalMatricesChanged[0] / 3;
int endn = (nNormalMatricesChanged[1] + 2) / 3;
@@ -190,7 +192,7 @@ void VertexShaderManager::SetConstants()
nNormalMatricesChanged[0] = nNormalMatricesChanged[1] = -1;
}
- if (nPostTransformMatricesChanged[0] >= 0 || g_ActiveConfig.bUseGLSL)
+ if (nPostTransformMatricesChanged[0] >= 0)
{
int startn = nPostTransformMatricesChanged[0] / 4;
int endn = (nPostTransformMatricesChanged[1] + 3 ) / 4;
@@ -198,7 +200,7 @@ void VertexShaderManager::SetConstants()
SetMultiVSConstant4fv(C_POSTTRANSFORMMATRICES + startn, endn - startn, pstart);
}
- if (nLightsChanged[0] >= 0 || g_ActiveConfig.bUseGLSL)
+ if (nLightsChanged[0] >= 0)
{
// lights don't have a 1 to 1 mapping, the color component needs to be converted to 4 floats
int istart = nLightsChanged[0] / 0x10;
@@ -234,14 +236,14 @@ void VertexShaderManager::SetConstants()
nLightsChanged[0] = nLightsChanged[1] = -1;
}
- if (nMaterialsChanged || g_ActiveConfig.bUseGLSL)
+ if (nMaterialsChanged)
{
float GC_ALIGNED16(material[4]);
float NormalizationCoef = 1 / 255.0f;
for (int i = 0; i < 4; ++i)
{
- if (nMaterialsChanged & (1 << i) || g_ActiveConfig.bUseGLSL)
+ if (nMaterialsChanged & (1 << i))
{
u32 data = *(xfregs.ambColor + i);
@@ -257,7 +259,7 @@ void VertexShaderManager::SetConstants()
nMaterialsChanged = 0;
}
- if (bPosNormalMatrixChanged || g_ActiveConfig.bUseGLSL)
+ if (bPosNormalMatrixChanged)
{
bPosNormalMatrixChanged = false;
@@ -268,7 +270,7 @@ void VertexShaderManager::SetConstants()
SetMultiVSConstant3fv(C_POSNORMALMATRIX + 3, 3, norm);
}
- if (bTexMatricesChanged[0] || g_ActiveConfig.bUseGLSL)
+ if (bTexMatricesChanged[0])
{
bTexMatricesChanged[0] = false;
const float *fptrs[] =
@@ -283,7 +285,7 @@ void VertexShaderManager::SetConstants()
}
}
- if (bTexMatricesChanged[1] || g_ActiveConfig.bUseGLSL)
+ if (bTexMatricesChanged[1])
{
bTexMatricesChanged[1] = false;
const float *fptrs[] = {
@@ -297,7 +299,7 @@ void VertexShaderManager::SetConstants()
}
}
- if (bViewportChanged || g_ActiveConfig.bUseGLSL)
+ if (bViewportChanged)
{
bViewportChanged = false;
SetVSConstant4f(C_DEPTHPARAMS,xfregs.viewport.farZ / 16777216.0f,xfregs.viewport.zRange / 16777216.0f,0.0f,0.0f);
@@ -306,7 +308,7 @@ void VertexShaderManager::SetConstants()
bProjectionChanged = true;
}
- if (bProjectionChanged || g_ActiveConfig.bUseGLSL)
+ if (bProjectionChanged)
{
bProjectionChanged = false;