2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:09:55 +00:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "VideoCommon/CPMemory.h"
|
2014-08-27 17:26:06 +00:00
|
|
|
#include "Common/ChunkFile.h"
|
2008-12-08 05:30:24 +00:00
|
|
|
|
|
|
|
// CP state
|
2014-08-27 17:26:06 +00:00
|
|
|
CPState g_main_cp_state;
|
2014-08-27 17:38:00 +00:00
|
|
|
CPState g_preprocess_cp_state;
|
2014-08-27 17:26:06 +00:00
|
|
|
|
|
|
|
void DoCPState(PointerWrap& p)
|
|
|
|
{
|
2014-08-27 17:38:00 +00:00
|
|
|
// We don't save g_preprocess_cp_state separately because the GPU should be
|
|
|
|
// synced around state save/load.
|
2015-09-29 16:35:30 +00:00
|
|
|
p.DoArray(g_main_cp_state.array_bases);
|
|
|
|
p.DoArray(g_main_cp_state.array_strides);
|
2014-08-27 17:26:06 +00:00
|
|
|
p.Do(g_main_cp_state.matrix_index_a);
|
|
|
|
p.Do(g_main_cp_state.matrix_index_b);
|
2021-02-08 23:22:10 +00:00
|
|
|
u64 vtx_desc = g_main_cp_state.vtx_desc.GetLegacyHex();
|
|
|
|
p.Do(vtx_desc);
|
|
|
|
g_main_cp_state.vtx_desc.SetLegacyHex(vtx_desc);
|
2015-09-29 16:35:30 +00:00
|
|
|
p.DoArray(g_main_cp_state.vtx_attr);
|
2014-08-27 17:26:06 +00:00
|
|
|
p.DoMarker("CP Memory");
|
2014-08-27 17:38:00 +00:00
|
|
|
if (p.mode == PointerWrap::MODE_READ)
|
2015-05-29 15:58:27 +00:00
|
|
|
{
|
2014-08-27 17:38:00 +00:00
|
|
|
CopyPreprocessCPStateFromMain();
|
2015-05-29 15:58:27 +00:00
|
|
|
g_main_cp_state.bases_dirty = true;
|
|
|
|
}
|
2014-08-27 17:38:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CopyPreprocessCPStateFromMain()
|
|
|
|
{
|
2015-01-07 20:48:59 +00:00
|
|
|
memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
|
2014-08-27 17:26:06 +00:00
|
|
|
}
|