From f0131c2e09faba0d65fa5b7360898e514e3636f5 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 27 Aug 2014 13:26:06 -0400 Subject: Mechanical changes to move most CP state to a struct rather than separate globals. The next commit will add a separate copy of the struct and the ability for LoadCPReg to work on it. --- Source/Core/VideoCommon/VideoState.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'Source/Core/VideoCommon/VideoState.cpp') diff --git a/Source/Core/VideoCommon/VideoState.cpp b/Source/Core/VideoCommon/VideoState.cpp index a8d5ddcf04..72232e2737 100644 --- a/Source/Core/VideoCommon/VideoState.cpp +++ b/Source/Core/VideoCommon/VideoState.cpp @@ -22,13 +22,7 @@ static void DoState(PointerWrap &p) p.DoMarker("BP Memory"); // CP Memory - p.DoArray(arraybases, 16); - p.DoArray(arraystrides, 16); - p.Do(MatrixIndexA); - p.Do(MatrixIndexB); - p.Do(g_VtxDesc.Hex); - p.DoArray(g_VtxAttr, 8); - p.DoMarker("CP Memory"); + DoCPState(p); // XF Memory p.Do(xfmem); @@ -73,11 +67,6 @@ void VideoCommon_RunLoop(bool enable) void VideoCommon_Init() { - memset(arraybases, 0, sizeof(arraybases)); - memset(arraystrides, 0, sizeof(arraystrides)); - memset(&MatrixIndexA, 0, sizeof(MatrixIndexA)); - memset(&MatrixIndexB, 0, sizeof(MatrixIndexB)); - memset(&g_VtxDesc, 0, sizeof(g_VtxDesc)); - memset(g_VtxAttr, 0, sizeof(g_VtxAttr)); + memset(&g_main_cp_state, 0, sizeof(g_main_cp_state)); memset(texMem, 0, TMEM_SIZE); } -- cgit v1.2.3 From e86ddacb18affaef2d773b0c86fdf57f93d594c4 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 27 Aug 2014 13:38:00 -0400 Subject: Changes to allow LoadCPReg to work in a preprocess mode which affects a separate state. This state will be used to calculate sizes for skipping over commands on a separate thread. An alternative to having these state variables would be to have the preprocessor stash "state as we go" somewhere, but I think that would be much uglier. GetVertexSize now takes an extra argument to determine which state to use, as does FifoCommandRunnable, which calls it. While I'm modifying FifoCommandRunnable, I also change it to take a buffer and size as parameters rather than using g_pVideoData, which will also be necessary later. I also get rid of an unused overload. --- Source/Core/VideoCommon/VideoState.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/VideoCommon/VideoState.cpp') diff --git a/Source/Core/VideoCommon/VideoState.cpp b/Source/Core/VideoCommon/VideoState.cpp index 72232e2737..dd0eb2fb88 100644 --- a/Source/Core/VideoCommon/VideoState.cpp +++ b/Source/Core/VideoCommon/VideoState.cpp @@ -68,5 +68,6 @@ void VideoCommon_RunLoop(bool enable) void VideoCommon_Init() { memset(&g_main_cp_state, 0, sizeof(g_main_cp_state)); + memset(&g_preprocess_cp_state, 0, sizeof(g_preprocess_cp_state)); memset(texMem, 0, TMEM_SIZE); } -- cgit v1.2.3