2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:09:55 -06:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-07 22:30:24 -07:00
|
|
|
|
2014-08-27 11:26:06 -06:00
|
|
|
#include "Common/ChunkFile.h"
|
2014-09-07 19:06:58 -06:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "VideoCommon/CPMemory.h"
|
2008-12-07 22:30:24 -07:00
|
|
|
|
|
|
|
// CP state
|
2014-08-27 11:26:06 -06:00
|
|
|
CPState g_main_cp_state;
|
2014-08-27 11:38:00 -06:00
|
|
|
CPState g_preprocess_cp_state;
|
2014-08-27 11:26:06 -06:00
|
|
|
|
|
|
|
void DoCPState(PointerWrap& p)
|
|
|
|
{
|
2014-08-27 11:38:00 -06:00
|
|
|
// We don't save g_preprocess_cp_state separately because the GPU should be
|
|
|
|
// synced around state save/load.
|
2014-08-27 11:26:06 -06:00
|
|
|
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");
|
2014-08-27 11:38:00 -06:00
|
|
|
if (p.mode == PointerWrap::MODE_READ)
|
|
|
|
CopyPreprocessCPStateFromMain();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CopyPreprocessCPStateFromMain()
|
|
|
|
{
|
2015-01-07 13:48:59 -07:00
|
|
|
memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
|
2014-08-27 11:26:06 -06:00
|
|
|
}
|