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
|
|
|
|
2016-01-17 22:54:31 +01:00
|
|
|
#include <cstring>
|
|
|
|
|
2014-07-30 02:55:07 +02:00
|
|
|
#include "Common/ChunkFile.h"
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "VideoCommon/BPMemory.h"
|
2014-02-19 02:27:20 +01:00
|
|
|
#include "VideoCommon/BoundingBox.h"
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "VideoCommon/CPMemory.h"
|
2014-12-14 21:23:13 +01:00
|
|
|
#include "VideoCommon/CommandProcessor.h"
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "VideoCommon/Fifo.h"
|
2019-06-29 13:05:30 +02:00
|
|
|
#include "VideoCommon/FramebufferManager.h"
|
2014-12-14 21:23:13 +01:00
|
|
|
#include "VideoCommon/GeometryShaderManager.h"
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "VideoCommon/PixelEngine.h"
|
|
|
|
#include "VideoCommon/PixelShaderManager.h"
|
2019-06-29 11:27:53 +02:00
|
|
|
#include "VideoCommon/RenderBase.h"
|
|
|
|
#include "VideoCommon/TextureCacheBase.h"
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "VideoCommon/TextureDecoder.h"
|
|
|
|
#include "VideoCommon/VertexManagerBase.h"
|
|
|
|
#include "VideoCommon/VertexShaderManager.h"
|
|
|
|
#include "VideoCommon/VideoState.h"
|
2014-02-19 02:27:20 +01:00
|
|
|
#include "VideoCommon/XFMemory.h"
|
2008-12-08 06:30:24 +01:00
|
|
|
|
2016-01-12 22:46:44 +01:00
|
|
|
void VideoCommon_DoState(PointerWrap& p)
|
2008-12-08 06:30:24 +01:00
|
|
|
{
|
2019-06-29 11:27:53 +02:00
|
|
|
bool software = false;
|
|
|
|
p.Do(software);
|
|
|
|
|
|
|
|
if (p.GetMode() == PointerWrap::MODE_READ && software == true)
|
|
|
|
{
|
|
|
|
// change mode to abort load of incompatible save state.
|
|
|
|
p.SetMode(PointerWrap::MODE_VERIFY);
|
|
|
|
}
|
|
|
|
|
2013-03-20 02:51:12 +01:00
|
|
|
// BP Memory
|
|
|
|
p.Do(bpmem);
|
2012-01-01 22:52:31 +01:00
|
|
|
p.DoMarker("BP Memory");
|
2008-12-08 06:30:24 +01:00
|
|
|
|
2013-03-20 02:51:12 +01:00
|
|
|
// CP Memory
|
2012-01-01 22:52:31 +01:00
|
|
|
DoCPState(p);
|
|
|
|
|
|
|
|
// XF Memory
|
2015-09-29 18:35:30 +02:00
|
|
|
p.Do(xfmem);
|
2012-01-01 22:52:31 +01:00
|
|
|
p.DoMarker("XF Memory");
|
2013-10-29 06:23:17 +01:00
|
|
|
|
2013-03-20 02:51:12 +01:00
|
|
|
// Texture decoder
|
2016-01-12 22:44:58 +01:00
|
|
|
p.DoArray(texMem);
|
2012-01-01 22:52:31 +01:00
|
|
|
p.DoMarker("texMem");
|
2009-10-10 23:19:39 +02:00
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
// FIFO
|
2013-03-20 02:51:12 +01:00
|
|
|
Fifo::DoState(p);
|
2012-01-01 22:52:31 +01:00
|
|
|
p.DoMarker("Fifo");
|
|
|
|
|
|
|
|
CommandProcessor::DoState(p);
|
|
|
|
p.DoMarker("CommandProcessor");
|
2012-01-01 21:46:02 +01:00
|
|
|
|
|
|
|
PixelEngine::DoState(p);
|
2012-01-01 22:52:31 +01:00
|
|
|
p.DoMarker("PixelEngine");
|
|
|
|
|
2012-01-01 21:46:02 +01:00
|
|
|
// the old way of replaying current bpmem as writes to push side effects to pixel shader manager
|
|
|
|
// doesn't really work.
|
|
|
|
PixelShaderManager::DoState(p);
|
2012-01-01 22:52:31 +01:00
|
|
|
p.DoMarker("PixelShaderManager");
|
2012-01-01 21:46:02 +01:00
|
|
|
|
2014-12-14 21:23:13 +01:00
|
|
|
VertexShaderManager::DoState(p);
|
|
|
|
p.DoMarker("VertexShaderManager");
|
|
|
|
|
2015-11-01 22:54:41 +01:00
|
|
|
GeometryShaderManager::DoState(p);
|
2012-01-04 09:42:22 +01:00
|
|
|
p.DoMarker("GeometryShaderManager");
|
|
|
|
|
2016-08-22 05:02:37 +02:00
|
|
|
g_vertex_manager->DoState(p);
|
2014-09-14 18:52:51 +02:00
|
|
|
p.DoMarker("VertexManager");
|
|
|
|
|
|
|
|
BoundingBox::DoState(p);
|
|
|
|
p.DoMarker("BoundingBox");
|
|
|
|
|
2019-06-29 13:05:30 +02:00
|
|
|
g_framebuffer_manager->DoState(p);
|
|
|
|
p.DoMarker("FramebufferManager");
|
|
|
|
|
2019-06-29 11:27:53 +02:00
|
|
|
g_texture_cache->DoState(p);
|
|
|
|
p.DoMarker("TextureCache");
|
|
|
|
|
|
|
|
g_renderer->DoState(p);
|
|
|
|
p.DoMarker("Renderer");
|
|
|
|
|
|
|
|
// Refresh state.
|
|
|
|
if (p.GetMode() == PointerWrap::MODE_READ)
|
|
|
|
{
|
|
|
|
// Inform backend of new state from registers.
|
|
|
|
BPReload();
|
|
|
|
}
|
2008-12-08 06:30:24 +01:00
|
|
|
}
|