diff options
author | Yuri Roubinski <chaosus89@gmail.com> | 2019-08-13 16:19:14 +0300 |
---|---|---|
committer | Yuri Roubinski <chaosus89@gmail.com> | 2019-08-13 18:39:55 +0300 |
commit | a525e3c5ceb5e463575cb06f4a33b9585086ce38 (patch) | |
tree | e032e09b667c2783acade95ff26ac7273db3bc8c /drivers/gles2 | |
parent | 0a10a93fb0d2467fd836ad38501550ca79f0fa72 (diff) |
Implemented do/while loops for shaders
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/shader_compiler_gles2.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 935cb32fda..9c9a8e9717 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -802,6 +802,14 @@ 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_DO) { + code += _mktab(p_level); + code += "do"; + code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); + code += _mktab(p_level); + code += "while ("; + code += _dump_node_code(cf_node->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += ");"; } else if (cf_node->flow_op == SL::FLOW_OP_WHILE) { code += _mktab(p_level); code += "while ("; |