From 6b7f8558d962bf67d4cc4bc1d539b925787fdc03 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sat, 2 Nov 2019 12:36:43 +0300 Subject: Removed switch operator from GLES2 shader back-end --- drivers/gles2/shader_compiler_gles2.cpp | 9 --------- servers/visual/shader_language.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 1db8a870a2..7e9b6fdb82 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -809,15 +809,6 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener code += "else\n"; 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) { code += _mktab(p_level); code += "do"; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index a57ab92085..f791298472 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -4176,6 +4176,12 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Mapis_low_end()) { + _set_error("\"switch\" operator is supported only on high-end platform!"); + return ERR_PARSE_ERROR; + } + // switch() {} tk = _get_token(); if (tk.type != TK_PARENTHESIS_OPEN) { -- cgit v1.2.3