VideoCommon: add TextureData structure that contains the raw texture data, a sampler, and the type of texture information

This commit is contained in:
iwubcode
2023-08-24 00:35:31 -05:00
parent 260bad74ea
commit 7c52a52440
2 changed files with 151 additions and 0 deletions

View File

@ -3,8 +3,11 @@
#pragma once
#include <picojson.h>
#include "VideoCommon/Assets/CustomAsset.h"
#include "VideoCommon/Assets/CustomTextureData.h"
#include "VideoCommon/RenderState.h"
namespace VideoCommon
{
@ -17,6 +20,21 @@ private:
CustomAssetLibrary::LoadInfo LoadImpl(const CustomAssetLibrary::AssetID& asset_id) override;
};
struct TextureData
{
static bool FromJson(const CustomAssetLibrary::AssetID& asset_id, const picojson::object& json,
TextureData* data);
enum class Type
{
Type_Undefined,
Type_Texture2D,
Type_Max = Type_Texture2D
};
Type m_type;
CustomTextureData m_data;
SamplerState m_sampler;
};
class GameTextureAsset final : public CustomLoadableAsset<CustomTextureData>
{
public: