summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/CPMemory.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2015-06-10 00:00:12 +0200
committerJules Blok <jules.blok@gmail.com>2015-06-10 00:00:12 +0200
commit7dfced21a2e5aac7195e0e1ad76468e30306766b (patch)
treebd671b639d3d911460b767caabad8fc8a759a6bf /Source/Core/VideoCommon/CPMemory.cpp
parentc25be031fc1031d795157d8344b87b7841145197 (diff)
parent7b0a65e295c784f9d573f2ef52d4e2a7b9bb2889 (diff)
Merge branch 'master' into stable
Diffstat (limited to 'Source/Core/VideoCommon/CPMemory.cpp')
-rw-r--r--Source/Core/VideoCommon/CPMemory.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/CPMemory.cpp b/Source/Core/VideoCommon/CPMemory.cpp
new file mode 100644
index 0000000000..5fc7bbe98d
--- /dev/null
+++ b/Source/Core/VideoCommon/CPMemory.cpp
@@ -0,0 +1,34 @@
+// Copyright 2008 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "Common/ChunkFile.h"
+#include "Common/CommonTypes.h"
+#include "VideoCommon/CPMemory.h"
+
+// CP state
+CPState g_main_cp_state;
+CPState g_preprocess_cp_state;
+
+void DoCPState(PointerWrap& p)
+{
+ // We don't save g_preprocess_cp_state separately because the GPU should be
+ // synced around state save/load.
+ p.DoArray(g_main_cp_state.array_bases, 16);
+ p.DoArray(g_main_cp_state.array_strides, 16);
+ p.Do(g_main_cp_state.matrix_index_a);
+ p.Do(g_main_cp_state.matrix_index_b);
+ p.Do(g_main_cp_state.vtx_desc.Hex);
+ p.DoArray(g_main_cp_state.vtx_attr, 8);
+ p.DoMarker("CP Memory");
+ if (p.mode == PointerWrap::MODE_READ)
+ {
+ CopyPreprocessCPStateFromMain();
+ g_main_cp_state.bases_dirty = true;
+ }
+}
+
+void CopyPreprocessCPStateFromMain()
+{
+ memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
+}