mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
VideoBackends: Merge Initialize and Shutdown functions.
This commit is contained in:
@ -453,10 +453,6 @@ void SetCPStatusFromCPU()
|
||||
}
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
void SetCpStatusRegister()
|
||||
{
|
||||
// Here always there is one fifo attached to the GPU
|
||||
|
@ -119,7 +119,6 @@ union UCPClearReg {
|
||||
|
||||
// Init
|
||||
void Init();
|
||||
void Shutdown();
|
||||
void DoState(PointerWrap& p);
|
||||
|
||||
void RegisterMMIO(MMIO::Mapping* mmio, u32 base);
|
||||
|
@ -30,10 +30,6 @@ void GeometryShaderManager::Init()
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
void GeometryShaderManager::Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
void GeometryShaderManager::Dirty()
|
||||
{
|
||||
// This function is called after a savestate is loaded.
|
||||
|
@ -15,7 +15,6 @@ class GeometryShaderManager
|
||||
public:
|
||||
static void Init();
|
||||
static void Dirty();
|
||||
static void Shutdown();
|
||||
static void DoState(PointerWrap& p);
|
||||
|
||||
static void SetConstants();
|
||||
|
@ -9,12 +9,22 @@
|
||||
#include "Common/Event.h"
|
||||
#include "Common/Flag.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/Host.h"
|
||||
#include "VideoCommon/AsyncRequests.h"
|
||||
#include "VideoCommon/BPStructs.h"
|
||||
#include "VideoCommon/CPMemory.h"
|
||||
#include "VideoCommon/CommandProcessor.h"
|
||||
#include "VideoCommon/Fifo.h"
|
||||
#include "VideoCommon/GeometryShaderManager.h"
|
||||
#include "VideoCommon/IndexGenerator.h"
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
#include "VideoCommon/OpcodeDecoding.h"
|
||||
#include "VideoCommon/PixelEngine.h"
|
||||
#include "VideoCommon/PixelShaderManager.h"
|
||||
#include "VideoCommon/RenderBase.h"
|
||||
#include "VideoCommon/TextureCacheBase.h"
|
||||
#include "VideoCommon/VertexLoaderManager.h"
|
||||
#include "VideoCommon/VertexShaderManager.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
#include "VideoCommon/VideoState.h"
|
||||
@ -149,11 +159,58 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index)
|
||||
|
||||
void VideoBackendBase::InitializeShared()
|
||||
{
|
||||
VideoCommon_Init();
|
||||
memset(&g_main_cp_state, 0, sizeof(g_main_cp_state));
|
||||
memset(&g_preprocess_cp_state, 0, sizeof(g_preprocess_cp_state));
|
||||
memset(texMem, 0, TMEM_SIZE);
|
||||
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::CallbackType::Initialization);
|
||||
|
||||
// do not initialize again for the config window
|
||||
m_initialized = true;
|
||||
|
||||
s_FifoShuttingDown.Clear();
|
||||
memset((void*)&s_beginFieldArgs, 0, sizeof(s_beginFieldArgs));
|
||||
m_invalid = false;
|
||||
frameCount = 0;
|
||||
|
||||
CommandProcessor::Init();
|
||||
Fifo::Init();
|
||||
OpcodeDecoder::Init();
|
||||
PixelEngine::Init();
|
||||
BPInit();
|
||||
VertexLoaderManager::Init();
|
||||
IndexGenerator::Init();
|
||||
VertexShaderManager::Init();
|
||||
GeometryShaderManager::Init();
|
||||
PixelShaderManager::Init();
|
||||
|
||||
if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini"))
|
||||
g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini");
|
||||
else
|
||||
g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + GetConfigName() + ".ini");
|
||||
g_Config.GameIniLoad();
|
||||
g_Config.UpdateProjectionHack();
|
||||
g_Config.VerifyValidity();
|
||||
UpdateActiveConfig();
|
||||
|
||||
// Notify the core that the video backend is ready
|
||||
Host_Message(WM_USER_CREATE);
|
||||
}
|
||||
|
||||
void VideoBackendBase::ShutdownShared()
|
||||
{
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::CallbackType::Shutdown);
|
||||
|
||||
m_initialized = false;
|
||||
|
||||
Fifo::Shutdown();
|
||||
}
|
||||
|
||||
void VideoBackendBase::CleanupShared()
|
||||
{
|
||||
VertexLoaderManager::Clear();
|
||||
}
|
||||
|
||||
// Run from the CPU thread
|
||||
|
@ -121,10 +121,6 @@ void Init()
|
||||
s_bFifoErrorSeen = false;
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
template <bool is_preprocess>
|
||||
u8* Run(DataReader src, u32* cycles, bool in_display_list)
|
||||
{
|
||||
|
@ -42,7 +42,6 @@ class DataReader;
|
||||
namespace OpcodeDecoder
|
||||
{
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
template <bool is_preprocess = false>
|
||||
u8* Run(DataReader src, u32* cycles, bool in_display_list);
|
||||
|
@ -56,10 +56,6 @@ void PixelShaderManager::Dirty()
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
void PixelShaderManager::Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
void PixelShaderManager::SetConstants()
|
||||
{
|
||||
if (s_bFogRangeAdjustChanged)
|
||||
|
@ -15,7 +15,6 @@ class PixelShaderManager
|
||||
public:
|
||||
static void Init();
|
||||
static void Dirty();
|
||||
static void Shutdown();
|
||||
static void DoState(PointerWrap& p);
|
||||
|
||||
static void SetConstants(); // sets pixel shader constants
|
||||
|
@ -57,7 +57,7 @@ void Init()
|
||||
SETSTAT(stats.numVertexLoaders, 0);
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
void Clear()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(s_vertex_loader_map_lock);
|
||||
s_vertex_loader_map.clear();
|
||||
|
@ -20,7 +20,7 @@ using NativeVertexFormatMap =
|
||||
std::unordered_map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>>;
|
||||
|
||||
void Init();
|
||||
void Shutdown();
|
||||
void Clear();
|
||||
|
||||
void MarkAllDirty();
|
||||
|
||||
|
@ -216,10 +216,6 @@ void VertexShaderManager::Init()
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
void VertexShaderManager::Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
void VertexShaderManager::Dirty()
|
||||
{
|
||||
// This function is called after a savestate is loaded.
|
||||
|
@ -19,7 +19,6 @@ class VertexShaderManager
|
||||
public:
|
||||
static void Init();
|
||||
static void Dirty();
|
||||
static void Shutdown();
|
||||
static void DoState(PointerWrap& p);
|
||||
|
||||
// constant management
|
||||
|
@ -73,6 +73,8 @@ public:
|
||||
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual std::string GetDisplayName() const { return GetName(); }
|
||||
virtual std::string GetConfigName() const = 0;
|
||||
|
||||
virtual void ShowConfig(void*) = 0;
|
||||
|
||||
virtual void Video_Prepare() = 0;
|
||||
@ -98,6 +100,8 @@ public:
|
||||
|
||||
protected:
|
||||
void InitializeShared();
|
||||
void ShutdownShared();
|
||||
void CleanupShared();
|
||||
|
||||
bool m_initialized = false;
|
||||
bool m_invalid = false;
|
||||
|
@ -65,10 +65,3 @@ void VideoCommon_DoState(PointerWrap& p)
|
||||
|
||||
// TODO: search for more data that should be saved and add it here
|
||||
}
|
||||
|
||||
void VideoCommon_Init()
|
||||
{
|
||||
memset(&g_main_cp_state, 0, sizeof(g_main_cp_state));
|
||||
memset(&g_preprocess_cp_state, 0, sizeof(g_preprocess_cp_state));
|
||||
memset(texMem, 0, TMEM_SIZE);
|
||||
}
|
||||
|
@ -7,4 +7,3 @@
|
||||
class PointerWrap;
|
||||
|
||||
void VideoCommon_DoState(PointerWrap& p);
|
||||
void VideoCommon_Init();
|
||||
|
Reference in New Issue
Block a user