2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 05:09:55 +02:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 06:30:24 +01:00
|
|
|
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "VideoCommon/CPMemory.h"
|
2016-06-24 10:43:46 +02:00
|
|
|
#include "Common/ChunkFile.h"
|
2008-12-08 06:30:24 +01:00
|
|
|
|
|
|
|
// CP state
|
2014-08-27 19:26:06 +02:00
|
|
|
CPState g_main_cp_state;
|
2014-08-27 19:38:00 +02:00
|
|
|
CPState g_preprocess_cp_state;
|
2014-08-27 19:26:06 +02:00
|
|
|
|
|
|
|
void DoCPState(PointerWrap& p)
|
|
|
|
{
|
2016-06-24 10:43:46 +02:00
|
|
|
// 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.Hex);
|
|
|
|
p.DoArray(g_main_cp_state.vtx_attr);
|
|
|
|
p.DoMarker("CP Memory");
|
|
|
|
if (p.mode == PointerWrap::MODE_READ)
|
|
|
|
{
|
|
|
|
CopyPreprocessCPStateFromMain();
|
|
|
|
g_main_cp_state.bases_dirty = true;
|
|
|
|
}
|
2014-08-27 19:38:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CopyPreprocessCPStateFromMain()
|
|
|
|
{
|
2016-06-24 10:43:46 +02:00
|
|
|
memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
|
2014-08-27 19:26:06 +02:00
|
|
|
}
|