Debian Codegraph @

Source/Core/VideoCommon/Assets/CustomAssetLibrary.h

raw symbols SCIP
1 // Copyright 2023 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <string>
7
8 namespace VideoCommon
9 {
10 class CustomTextureData;
11 struct MaterialData;
12 struct MeshData;
13 struct RasterSurfaceShaderData;
14 struct TextureAndSamplerData;
15
16 // This class provides functionality to load
17 // specific data (like textures). Where this data
18 // is loaded from is implementation defined
19 class CustomAssetLibrary
20 {
21 public:
22 // The AssetID is a unique identifier for a particular asset
23 using AssetID = std::string;
24
25 struct LoadInfo
26 {
27 std::size_t bytes_loaded = 0;
28 };
29
30 virtual ~CustomAssetLibrary() = default;
31
32 // Loads a texture with a sampler and type, if there are no levels, bytes loaded will be empty
33 virtual LoadInfo LoadTexture(const AssetID& asset_id, TextureAndSamplerData* data) = 0;
34
35 // Loads a texture, if there are no levels, bytes loaded will be empty
36 virtual LoadInfo LoadTexture(const AssetID& asset_id, CustomTextureData* data) = 0;
37
38 // Loads a raster surface shader
39 virtual LoadInfo LoadRasterSurfaceShader(const AssetID& asset_id,
40 RasterSurfaceShaderData* data) = 0;
41
42 // Loads a material
43 virtual LoadInfo LoadMaterial(const AssetID& asset_id, MaterialData* data) = 0;
44
45 // Loads a mesh
46 virtual LoadInfo LoadMesh(const AssetID& asset_id, MeshData* data) = 0;
47 };
48 } // namespace VideoCommon