summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderManager.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
index 2521f80500..258ec04413 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
@@ -302,7 +302,7 @@ void PixelShaderManager::SetConstants()
float GC_ALIGNED16(material[4]);
float NormalizationCoef = 1 / 255.0f;
- for (int i = 0; i < 4; ++i)
+ for (int i = 0; i < 2; ++i)
{
if (nMaterialsChanged & (1 << i))
{
@@ -316,6 +316,21 @@ void PixelShaderManager::SetConstants()
SetPSConstant4fv(C_PMATERIALS + i, material);
}
}
+
+ for (int i = 0; i < 2; ++i)
+ {
+ if (nMaterialsChanged & (1 << (i + 2)))
+ {
+ u32 data = *(xfregs.matColor + i);
+
+ material[0] = ((data >> 24) & 0xFF) * NormalizationCoef;
+ material[1] = ((data >> 16) & 0xFF) * NormalizationCoef;
+ material[2] = ((data >> 8) & 0xFF) * NormalizationCoef;
+ material[3] = ( data & 0xFF) * NormalizationCoef;
+
+ SetPSConstant4fv(C_PMATERIALS + i + 2, material);
+ }
+ }
nMaterialsChanged = 0;
}
@@ -465,3 +480,16 @@ void PixelShaderManager::SetMaterialColorChanged(int index)
{
nMaterialsChanged |= (1 << index);
}
+
+void PixelShaderManager::DoState(PointerWrap &p)
+{
+ p.Do(lastRGBAfull);
+ p.Do(lastAlpha);
+ p.Do(lastTexDims);
+ p.Do(lastZBias);
+
+ if (p.GetMode() == PointerWrap::MODE_READ)
+ {
+ Dirty();
+ }
+}