Removed switch operator from GLES2 shader back-end
This commit is contained in:
parent
36a785513f
commit
6b7f8558d9
2 changed files with 6 additions and 9 deletions
|
@ -809,15 +809,6 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
|
||||||
code += "else\n";
|
code += "else\n";
|
||||||
code += _dump_node_code(cf_node->blocks[1], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning);
|
code += _dump_node_code(cf_node->blocks[1], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||||
}
|
}
|
||||||
} else if (cf_node->flow_op == SL::FLOW_OP_SWITCH) {
|
|
||||||
code += _mktab(p_level) + "switch (" + _dump_node_code(cf_node->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ")\n";
|
|
||||||
code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning);
|
|
||||||
} else if (cf_node->flow_op == SL::FLOW_OP_CASE) {
|
|
||||||
code += _mktab(p_level) + "case " + _dump_node_code(cf_node->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ":\n";
|
|
||||||
code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning);
|
|
||||||
} else if (cf_node->flow_op == SL::FLOW_OP_DEFAULT) {
|
|
||||||
code += _mktab(p_level) + "default:\n";
|
|
||||||
code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning);
|
|
||||||
} else if (cf_node->flow_op == SL::FLOW_OP_DO) {
|
} else if (cf_node->flow_op == SL::FLOW_OP_DO) {
|
||||||
code += _mktab(p_level);
|
code += _mktab(p_level);
|
||||||
code += "do";
|
code += "do";
|
||||||
|
|
|
@ -4176,6 +4176,12 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
|
||||||
_set_tkpos(pos); //rollback
|
_set_tkpos(pos); //rollback
|
||||||
}
|
}
|
||||||
} else if (tk.type == TK_CF_SWITCH) {
|
} else if (tk.type == TK_CF_SWITCH) {
|
||||||
|
|
||||||
|
if (VisualServer::get_singleton()->is_low_end()) {
|
||||||
|
_set_error("\"switch\" operator is supported only on high-end platform!");
|
||||||
|
return ERR_PARSE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
// switch() {}
|
// switch() {}
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
if (tk.type != TK_PARENTHESIS_OPEN) {
|
if (tk.type != TK_PARENTHESIS_OPEN) {
|
||||||
|
|
Loading…
Reference in a new issue