Merge pull request #12166 from iwubcode/cubemap_shader_texture_integration

VideoCommon: add cubemap to ShaderAsset and TextureAsset
This commit is contained in:
Admiral H. Curtiss 2023-09-12 16:56:26 +02:00 committed by GitHub
commit 1a821465f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 7 deletions

View File

@ -49,6 +49,10 @@ bool ParseShaderProperties(const VideoCommon::CustomAssetLibrary::AssetID& asset
{
property.m_type = ShaderProperty::Type::Type_Sampler2D;
}
else if (type == "samplercube")
{
property.m_type = ShaderProperty::Type::Type_SamplerCube;
}
else if (type == "samplerarrayshared_main")
{
property.m_type = ShaderProperty::Type::Type_SamplerArrayShared_Main;

View File

@ -26,7 +26,8 @@ struct ShaderProperty
Type_SamplerArrayShared_Main,
Type_SamplerArrayShared_Additional,
Type_Sampler2D,
Type_Max = Type_Sampler2D
Type_SamplerCube,
Type_Max = Type_SamplerCube
};
Type m_type;
std::string m_description;

View File

@ -136,6 +136,15 @@ bool TextureData::FromJson(const CustomAssetLibrary::AssetID& asset_id,
if (type == "texture2d")
{
data->m_type = TextureData::Type::Type_Texture2D;
if (!ParseSampler(asset_id, json, &data->m_sampler))
{
return false;
}
}
else if (type == "texturecube")
{
data->m_type = TextureData::Type::Type_TextureCube;
}
else
{
@ -146,11 +155,6 @@ bool TextureData::FromJson(const CustomAssetLibrary::AssetID& asset_id,
return false;
}
if (!ParseSampler(asset_id, json, &data->m_sampler))
{
return false;
}
return true;
}

View File

@ -28,7 +28,8 @@ struct TextureData
{
Type_Undefined,
Type_Texture2D,
Type_Max = Type_Texture2D
Type_TextureCube,
Type_Max = Type_TextureCube
};
Type m_type;
CustomTextureData m_data;