Debian Codegraph @

Source/Core/VideoCommon/Assets/TextureSamplerValue.h

raw symbols SCIP
1 // Copyright 2024 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <string>
7
8 #include <picojson.h>
9
10 #include "VideoCommon/Assets/CustomAssetLibrary.h"
11
12 namespace VideoCommon
13 {
14 // A structure that provides metadata about a texture to a material
15 struct TextureSamplerValue
16 {
17 CustomAssetLibrary::AssetID asset;
18
19 // Where does the sampler originate from
20 // If 'Asset' is used, the sampler is pulled
21 // directly from the asset properties
22 // If 'TextureHash' is chosen, the sampler is pulled
23 // from the game with the corresponding texture hash
24 enum class SamplerOrigin
25 {
26 Asset,
27 TextureHash
28 };
29 static std::string ToString(SamplerOrigin sampler_origin);
30 SamplerOrigin sampler_origin = SamplerOrigin::Asset;
31 std::string texture_hash;
32
33 static bool FromJson(const picojson::object& json, TextureSamplerValue* data);
34 static void ToJson(picojson::object* obj, const TextureSamplerValue& data);
35 };
36 } // namespace VideoCommon