Merge pull request #20681 from DavidSichma/master

Keeping track of discard
This commit is contained in:
Juan Linietsky 2018-08-08 09:54:59 -03:00 committed by GitHub
commit b67f982723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -704,6 +704,10 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
}
code += ";\n";
} else if (cf_node->flow_op == SL::FLOW_OP_DISCARD) {
if (p_actions.usage_flag_pointers.has("DISCARD") && !used_flag_pointers.has("DISCARD")) {
*p_actions.usage_flag_pointers["DISCARD"] = true;
used_flag_pointers.insert("DISCARD");
}
code += "discard;";
} else if (cf_node->flow_op == SL::FLOW_OP_CONTINUE) {
code += "continue;";

View File

@ -702,6 +702,11 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
}
} else if (cfnode->flow_op == SL::FLOW_OP_DISCARD) {
if (p_actions.usage_flag_pointers.has("DISCARD") && !used_flag_pointers.has("DISCARD")) {
*p_actions.usage_flag_pointers["DISCARD"] = true;
used_flag_pointers.insert("DISCARD");
}
code = "discard;";
} else if (cfnode->flow_op == SL::FLOW_OP_CONTINUE) {