2022-03-05 06:41:14 +00:00
|
|
|
// Copyright 2022 Dolphin Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <unordered_set>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "VideoCommon/GraphicsModSystem/Runtime/FBInfo.h"
|
|
|
|
#include "VideoCommon/GraphicsModSystem/Runtime/GraphicsModAction.h"
|
|
|
|
#include "VideoCommon/TextureInfo.h"
|
2023-01-30 11:46:10 +00:00
|
|
|
#include "VideoCommon/VideoEvents.h"
|
2023-01-31 04:29:16 +00:00
|
|
|
#include "VideoCommon/XFMemory.h"
|
2022-03-05 06:41:14 +00:00
|
|
|
|
|
|
|
class GraphicsModGroupConfig;
|
|
|
|
class GraphicsModManager
|
|
|
|
{
|
|
|
|
public:
|
2023-01-29 16:01:05 +00:00
|
|
|
bool Initialize();
|
|
|
|
|
2022-03-05 06:41:14 +00:00
|
|
|
const std::vector<GraphicsModAction*>& GetProjectionActions(ProjectionType projection_type) const;
|
|
|
|
const std::vector<GraphicsModAction*>&
|
|
|
|
GetProjectionTextureActions(ProjectionType projection_type,
|
|
|
|
const std::string& texture_name) const;
|
|
|
|
const std::vector<GraphicsModAction*>&
|
|
|
|
GetDrawStartedActions(const std::string& texture_name) const;
|
|
|
|
const std::vector<GraphicsModAction*>&
|
|
|
|
GetTextureLoadActions(const std::string& texture_name) const;
|
|
|
|
const std::vector<GraphicsModAction*>& GetEFBActions(const FBInfo& efb) const;
|
|
|
|
const std::vector<GraphicsModAction*>& GetXFBActions(const FBInfo& xfb) const;
|
|
|
|
|
|
|
|
void Load(const GraphicsModGroupConfig& config);
|
|
|
|
|
|
|
|
private:
|
2023-01-30 11:46:10 +00:00
|
|
|
void EndOfFrame();
|
2022-03-05 06:41:14 +00:00
|
|
|
void Reset();
|
|
|
|
|
|
|
|
class DecoratedAction;
|
|
|
|
|
|
|
|
static inline const std::vector<GraphicsModAction*> m_default = {};
|
|
|
|
std::list<std::unique_ptr<GraphicsModAction>> m_actions;
|
|
|
|
std::unordered_map<ProjectionType, std::vector<GraphicsModAction*>>
|
|
|
|
m_projection_target_to_actions;
|
|
|
|
std::unordered_map<std::string, std::vector<GraphicsModAction*>>
|
|
|
|
m_projection_texture_target_to_actions;
|
|
|
|
std::unordered_map<std::string, std::vector<GraphicsModAction*>> m_draw_started_target_to_actions;
|
2022-10-29 00:24:43 +00:00
|
|
|
std::unordered_map<std::string, std::vector<GraphicsModAction*>> m_load_texture_target_to_actions;
|
2022-03-05 06:41:14 +00:00
|
|
|
std::unordered_map<FBInfo, std::vector<GraphicsModAction*>, FBInfoHasher> m_efb_target_to_actions;
|
|
|
|
std::unordered_map<FBInfo, std::vector<GraphicsModAction*>, FBInfoHasher> m_xfb_target_to_actions;
|
|
|
|
|
|
|
|
std::unordered_set<std::string> m_groups;
|
2023-01-30 11:46:10 +00:00
|
|
|
|
2023-02-03 00:18:37 +00:00
|
|
|
Common::EventHook m_end_of_frame_event;
|
2022-03-05 06:41:14 +00:00
|
|
|
};
|
2023-01-29 16:01:05 +00:00
|
|
|
|
|
|
|
extern std::unique_ptr<GraphicsModManager> g_graphics_mod_manager;
|