Ensure that ZSlopes save/restore state correctly.

Had to re-do *ShaderManager so they saved their constant arrays
instead of completly rebuilding them on restore state.
This commit is contained in:
Scott Mansell
2015-01-16 05:29:39 +13:00
parent 128d303656
commit e88c02dece
6 changed files with 72 additions and 80 deletions

View File

@ -26,7 +26,11 @@ void GeometryShaderManager::Init()
{
memset(&constants, 0, sizeof(constants));
Dirty();
// Init any intial constants which aren't zero when bpmem is zero.
SetViewportChanged();
SetProjectionChanged();
dirty = true;
}
void GeometryShaderManager::Shutdown()
@ -35,12 +39,9 @@ void GeometryShaderManager::Shutdown()
void GeometryShaderManager::Dirty()
{
SetViewportChanged();
SetProjectionChanged();
SetLinePtWidthChanged();
for (int i = 0; i < 8; i++)
SetTexCoordChanged(i);
// This function is called after a savestate is loaded.
// Any constants that can changed based on settings should be re-calculated
s_projection_changed = true;
dirty = true;
}
@ -110,9 +111,14 @@ void GeometryShaderManager::SetTexCoordChanged(u8 texmapid)
void GeometryShaderManager::DoState(PointerWrap &p)
{
p.Do(s_projection_changed);
p.Do(s_viewport_changed);
p.Do(constants);
if (p.GetMode() == PointerWrap::MODE_READ)
{
// Reload current state from global GPU state
// Fixup the current state from global GPU state
// NOTE: This requires that all GPU memory has been loaded already.
Dirty();
}