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!!
This commit is contained in:
NanoByte011
2014-12-25 00:34:22 -07:00
committed by Scott Mansell
parent 4984215971
commit 937844b9e3
12 changed files with 173 additions and 4 deletions

View File

@ -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;