mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Simplify saving CP state
Rather than makring some parts of VertexLoaderManager dirty in some places and some in others, do it all in VideoState. Also, since CPState no longer contains pointers/non-CP data after d039b1bc0d
, we can just use p.Do on it instead of manually saving each field.
This commit is contained in:
@ -15,24 +15,6 @@
|
||||
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);
|
||||
p.DoArray(g_main_cp_state.array_strides);
|
||||
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);
|
||||
p.DoArray(g_main_cp_state.vtx_attr);
|
||||
p.DoMarker("CP Memory");
|
||||
if (p.IsReadMode())
|
||||
{
|
||||
CopyPreprocessCPStateFromMain();
|
||||
VertexLoaderManager::g_bases_dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CopyPreprocessCPStateFromMain()
|
||||
{
|
||||
std::memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
|
||||
|
Reference in New Issue
Block a user