Deserialization of SHMaterialSpec will return an empty SHMaterialSpec on failure now instead

This commit is contained in:
Kah Wei 2022-11-02 17:19:18 +08:00
parent d207042fec
commit 976c220145
1 changed files with 8 additions and 12 deletions

View File

@ -267,21 +267,17 @@ namespace YAML
static bool decode(YAML::Node const& node, SHMaterialSpec& rhs)
{
// Retrieve Shader Asset IDs
if (!node[VERT_SHADER_YAML_TAG.data()])
return false;
if (node[VERT_SHADER_YAML_TAG.data()])
rhs.vertexShader = node[VERT_SHADER_YAML_TAG.data()].as<AssetID>();
if (!node[FRAG_SHADER_YAML_TAG.data()])
return false;
if (node[FRAG_SHADER_YAML_TAG.data()])
rhs.fragShader = node[FRAG_SHADER_YAML_TAG.data()].as<AssetID>();
// Retrieve Subpass
if (!node[SUBPASS_YAML_TAG.data()])
return false;
if (node[SUBPASS_YAML_TAG.data()])
rhs.subpassName = node[SUBPASS_YAML_TAG.data()].as<std::string>();
// Retrieve
if (!node[PROPS_YAML_TAG.data()])
return false;
if (node[PROPS_YAML_TAG.data()])
rhs.properties = node[PROPS_YAML_TAG.data()];
return true;