summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/CPMemory.cpp
blob: 5fc7bbe98d33685d8a09be9bf0a12e4a41413d88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
#include "VideoCommon/CPMemory.h"

// CP state
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, 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");
	if (p.mode == PointerWrap::MODE_READ)
	{
		CopyPreprocessCPStateFromMain();
		g_main_cp_state.bases_dirty = true;
	}
}

void CopyPreprocessCPStateFromMain()
{
	memcpy(&g_preprocess_cp_state, &g_main_cp_state, sizeof(CPState));
}