| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <optional> |
| 7 |
#include <string> |
| 8 |
#include <variant> |
| 9 |
|
| 10 |
#include <picojson.h> |
| 11 |
|
| 12 |
#include "Common/CommonTypes.h" |
| 13 |
#include "VideoCommon/TextureDecoder.h" |
| 14 |
#include "VideoCommon/XFMemory.h" |
| 15 |
|
| 16 |
struct TextureTarget |
| 17 |
{ |
| 18 |
std::string m_texture_info_string; |
| 19 |
}; |
| 20 |
|
| 21 |
struct DrawStartedTextureTarget final : public TextureTarget |
| 22 |
{ |
| 23 |
}; |
| 24 |
|
| 25 |
struct LoadTextureTarget final : public TextureTarget |
| 26 |
{ |
| 27 |
}; |
| 28 |
|
| 29 |
struct CreateTextureTarget final : public TextureTarget |
| 30 |
{ |
| 31 |
}; |
| 32 |
|
| 33 |
struct FBTarget |
| 34 |
{ |
| 35 |
u32 m_height = 0; |
| 36 |
u32 m_width = 0; |
| 37 |
TextureFormat m_texture_format = TextureFormat::I4; |
| 38 |
}; |
| 39 |
|
| 40 |
struct EFBTarget final : public FBTarget |
| 41 |
{ |
| 42 |
}; |
| 43 |
|
| 44 |
struct XFBTarget final : public FBTarget |
| 45 |
{ |
| 46 |
}; |
| 47 |
|
| 48 |
struct ProjectionTarget |
| 49 |
{ |
| 50 |
std::optional<std::string> m_texture_info_string; |
| 51 |
ProjectionType m_projection_type = ProjectionType::Perspective; |
| 52 |
}; |
| 53 |
|
| 54 |
using GraphicsTargetConfig = |
| 55 |
std::variant<DrawStartedTextureTarget, LoadTextureTarget, CreateTextureTarget, EFBTarget, |
| 56 |
XFBTarget, ProjectionTarget>; |
| 57 |
|
| 58 |
void SerializeTargetToConfig(picojson::object& json_obj, const GraphicsTargetConfig& target); |
| 59 |
std::optional<GraphicsTargetConfig> DeserializeTargetFromConfig(const picojson::object& obj); |
| 60 |
|
| 61 |
void SerializeTargetToProfile(picojson::object* obj, const GraphicsTargetConfig& target); |
| 62 |
void DeserializeTargetFromProfile(const picojson::object& obj, GraphicsTargetConfig* target); |