mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
VideoCommon: add cubemap as a sampler target for shaders, add cubemap as a valid texture asset
This commit is contained in:
parent
9419d92446
commit
589834f562
@ -49,6 +49,10 @@ bool ParseShaderProperties(const VideoCommon::CustomAssetLibrary::AssetID& asset
|
|||||||
{
|
{
|
||||||
property.m_type = ShaderProperty::Type::Type_Sampler2D;
|
property.m_type = ShaderProperty::Type::Type_Sampler2D;
|
||||||
}
|
}
|
||||||
|
else if (type == "samplercube")
|
||||||
|
{
|
||||||
|
property.m_type = ShaderProperty::Type::Type_SamplerCube;
|
||||||
|
}
|
||||||
else if (type == "samplerarrayshared_main")
|
else if (type == "samplerarrayshared_main")
|
||||||
{
|
{
|
||||||
property.m_type = ShaderProperty::Type::Type_SamplerArrayShared_Main;
|
property.m_type = ShaderProperty::Type::Type_SamplerArrayShared_Main;
|
||||||
|
@ -26,7 +26,8 @@ struct ShaderProperty
|
|||||||
Type_SamplerArrayShared_Main,
|
Type_SamplerArrayShared_Main,
|
||||||
Type_SamplerArrayShared_Additional,
|
Type_SamplerArrayShared_Additional,
|
||||||
Type_Sampler2D,
|
Type_Sampler2D,
|
||||||
Type_Max = Type_Sampler2D
|
Type_SamplerCube,
|
||||||
|
Type_Max = Type_SamplerCube
|
||||||
};
|
};
|
||||||
Type m_type;
|
Type m_type;
|
||||||
std::string m_description;
|
std::string m_description;
|
||||||
|
@ -136,6 +136,15 @@ bool TextureData::FromJson(const CustomAssetLibrary::AssetID& asset_id,
|
|||||||
if (type == "texture2d")
|
if (type == "texture2d")
|
||||||
{
|
{
|
||||||
data->m_type = TextureData::Type::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
|
else
|
||||||
{
|
{
|
||||||
@ -146,11 +155,6 @@ bool TextureData::FromJson(const CustomAssetLibrary::AssetID& asset_id,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ParseSampler(asset_id, json, &data->m_sampler))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,8 @@ struct TextureData
|
|||||||
{
|
{
|
||||||
Type_Undefined,
|
Type_Undefined,
|
||||||
Type_Texture2D,
|
Type_Texture2D,
|
||||||
Type_Max = Type_Texture2D
|
Type_TextureCube,
|
||||||
|
Type_Max = Type_TextureCube
|
||||||
};
|
};
|
||||||
Type m_type;
|
Type m_type;
|
||||||
CustomTextureData m_data;
|
CustomTextureData m_data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user