summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2012-12-24 13:30:59 +0100
committerdegasus <wickmarkus@web.de>2012-12-24 13:30:59 +0100
commit78ff8a769c5401facf060c9c7d92a8347076f353 (patch)
tree694828b6f93459b351ea764c3ccb2048cad37f80 /Source/Core/VideoCommon
parenteedca572702c7416805375bd652c56af8665d167 (diff)
parentbd0abb3d2fe5047554bb6b87fa8e3f6aa3f42e0b (diff)
Merge branch 'osx-savegame-fix'
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/BPStructs.cpp9
-rw-r--r--Source/Core/VideoCommon/Src/MainBase.cpp14
-rw-r--r--Source/Core/VideoCommon/Src/VertexManagerBase.cpp4
3 files changed, 22 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp
index 179196e412..0bde9cc613 100644
--- a/Source/Core/VideoCommon/Src/BPStructs.cpp
+++ b/Source/Core/VideoCommon/Src/BPStructs.cpp
@@ -34,9 +34,9 @@
using namespace BPFunctions;
-u32 mapTexAddress;
-bool mapTexFound;
-int numWrites;
+static u32 mapTexAddress;
+static bool mapTexFound;
+static int numWrites;
extern volatile bool g_bSkipCurrentFrame;
@@ -81,6 +81,9 @@ void BPWritten(const BPCmd& bp)
just stuff geometry in them and don't put state changes there
----------------------------------------------------------------------------------------------------------------
*/
+
+ // check for invalid state, else unneeded configuration are built
+ g_video_backend->CheckInvalidState();
// Debugging only, this lets you skip a bp update
//static int times = 0;
diff --git a/Source/Core/VideoCommon/Src/MainBase.cpp b/Source/Core/VideoCommon/Src/MainBase.cpp
index cb6dc7ae5b..726ef71b38 100644
--- a/Source/Core/VideoCommon/Src/MainBase.cpp
+++ b/Source/Core/VideoCommon/Src/MainBase.cpp
@@ -180,6 +180,7 @@ void VideoBackendHardware::InitializeShared()
memset((void*)&s_beginFieldArgs, 0, sizeof(s_beginFieldArgs));
memset(&s_accessEFBArgs, 0, sizeof(s_accessEFBArgs));
s_AccessEFBResult = 0;
+ m_invalid = false;
}
// Run from the CPU thread
@@ -198,16 +199,25 @@ void VideoBackendHardware::DoState(PointerWrap& p)
// Refresh state.
if (p.GetMode() == PointerWrap::MODE_READ)
{
- BPReload();
+ m_invalid = true;
RecomputeCachedArraybases();
// Clear all caches that touch RAM
// (? these don't appear to touch any emulation state that gets saved. moved to on load only.)
- TextureCache::Invalidate();
VertexLoaderManager::MarkAllDirty();
}
}
+void VideoBackendHardware::CheckInvalidState() {
+ if (m_invalid)
+ {
+ m_invalid = false;
+
+ BPReload();
+ TextureCache::Invalidate();
+ }
+}
+
void VideoBackendHardware::PauseAndLock(bool doLock, bool unpauseOnUnlock)
{
Fifo_PauseAndLock(doLock, unpauseOnUnlock);
diff --git a/Source/Core/VideoCommon/Src/VertexManagerBase.cpp b/Source/Core/VideoCommon/Src/VertexManagerBase.cpp
index 4118e3dcbd..5be72e4fcf 100644
--- a/Source/Core/VideoCommon/Src/VertexManagerBase.cpp
+++ b/Source/Core/VideoCommon/Src/VertexManagerBase.cpp
@@ -9,6 +9,7 @@
#include "NativeVertexFormat.h"
#include "TextureCacheBase.h"
#include "RenderBase.h"
+#include "BPStructs.h"
#include "VertexManagerBase.h"
#include "VideoConfig.h"
@@ -159,6 +160,9 @@ void VertexManager::AddVertices(int primitive, int numVertices)
void VertexManager::Flush()
{
+ // loading a state will invalidate BP, so check for it
+ g_video_backend->CheckInvalidState();
+
g_vertex_manager->vFlush();
}