Deserialization of SHMaterialSpec will return an empty SHMaterialSpec on failure now instead
This commit is contained in:
parent
d207042fec
commit
976c220145
|
@ -267,22 +267,18 @@ namespace YAML
|
||||||
static bool decode(YAML::Node const& node, SHMaterialSpec& rhs)
|
static bool decode(YAML::Node const& node, SHMaterialSpec& rhs)
|
||||||
{
|
{
|
||||||
// Retrieve Shader Asset IDs
|
// Retrieve Shader Asset IDs
|
||||||
if (!node[VERT_SHADER_YAML_TAG.data()])
|
if (node[VERT_SHADER_YAML_TAG.data()])
|
||||||
return false;
|
rhs.vertexShader = node[VERT_SHADER_YAML_TAG.data()].as<AssetID>();
|
||||||
rhs.vertexShader = node[VERT_SHADER_YAML_TAG.data()].as<AssetID>();
|
if (node[FRAG_SHADER_YAML_TAG.data()])
|
||||||
if (!node[FRAG_SHADER_YAML_TAG.data()])
|
rhs.fragShader = node[FRAG_SHADER_YAML_TAG.data()].as<AssetID>();
|
||||||
return false;
|
|
||||||
rhs.fragShader = node[FRAG_SHADER_YAML_TAG.data()].as<AssetID>();
|
|
||||||
|
|
||||||
// Retrieve Subpass
|
// Retrieve Subpass
|
||||||
if (!node[SUBPASS_YAML_TAG.data()])
|
if (node[SUBPASS_YAML_TAG.data()])
|
||||||
return false;
|
rhs.subpassName = node[SUBPASS_YAML_TAG.data()].as<std::string>();
|
||||||
rhs.subpassName = node[SUBPASS_YAML_TAG.data()].as<std::string>();
|
|
||||||
|
|
||||||
// Retrieve
|
// Retrieve
|
||||||
if (!node[PROPS_YAML_TAG.data()])
|
if (node[PROPS_YAML_TAG.data()])
|
||||||
return false;
|
rhs.properties = node[PROPS_YAML_TAG.data()];
|
||||||
rhs.properties = node[PROPS_YAML_TAG.data()];
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue