diff options
| author | Scott Mansell <phiren@gmail.com> | 2015-01-16 05:29:39 +1300 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2015-01-23 03:32:31 +1300 |
| commit | e88c02dece0e5e8d3b019fd0137eab790d6d2036 (patch) | |
| tree | 47339f400d7f26ddf65d31906278aa24dfa36538 /Source/Core/VideoCommon/GeometryShaderManager.cpp | |
| parent | 128d3036564e99fd3c8d7e6ae45eb17e43d0c95f (diff) | |
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.
Diffstat (limited to 'Source/Core/VideoCommon/GeometryShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GeometryShaderManager.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/GeometryShaderManager.cpp b/Source/Core/VideoCommon/GeometryShaderManager.cpp index 3e96592625..0a07cf683c 100644 --- a/Source/Core/VideoCommon/GeometryShaderManager.cpp +++ b/Source/Core/VideoCommon/GeometryShaderManager.cpp @@ -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(); } |
