summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer_rd/shader_compiler_rd.cpp
diff options
context:
space:
mode:
authorYuri Roubinski <chaosus89@gmail.com>2019-08-21 11:33:03 +0300
committerYuri Roubinski <chaosus89@gmail.com>2020-02-11 11:59:51 +0100
commit95e8375efb298d49a8000eac92f81a53190c8c6f (patch)
tree287b6f683affe9b239aeee36935ee02e93c0d521 /servers/visual/rasterizer_rd/shader_compiler_rd.cpp
parent8cee7703a6673f9505332de1581055c821b756f0 (diff)
[Vulkan] Implemented do/while loops for shaders
Diffstat (limited to 'servers/visual/rasterizer_rd/shader_compiler_rd.cpp')
-rw-r--r--servers/visual/rasterizer_rd/shader_compiler_rd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/visual/rasterizer_rd/shader_compiler_rd.cpp b/servers/visual/rasterizer_rd/shader_compiler_rd.cpp
index b43fabce59..5e1456dbb8 100644
--- a/servers/visual/rasterizer_rd/shader_compiler_rd.cpp
+++ b/servers/visual/rasterizer_rd/shader_compiler_rd.cpp
@@ -752,6 +752,10 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge
code += _mktab(p_level) + "else\n";
code += _dump_node_code(cfnode->blocks[1], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning);
}
+ } else if (cfnode->flow_op == SL::FLOW_OP_DO) {
+ code += _mktab(p_level) + "do";
+ code += _dump_node_code(cfnode->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning);
+ code += _mktab(p_level) + "while (" + _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ");";
} else if (cfnode->flow_op == SL::FLOW_OP_WHILE) {
code += _mktab(p_level) + "while (" + _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ")\n";