diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2020-04-11 12:40:17 +0300 |
---|---|---|
committer | Yuri Roubinsky <chaosus89@gmail.com> | 2020-04-11 12:40:17 +0300 |
commit | bc30f541e60f7236b0463072d31cc5322d78ecd2 (patch) | |
tree | db82e4ae0690506b1b246f561d92cbfa2ca80c5e /drivers/gles2 | |
parent | 8806e7d5f3e65a06be1b0a58dc73442e58fdf469 (diff) |
Fix shader constant sorting
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/shader_compiler_gles2.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 699d6e1484..92c1ada850 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -404,18 +404,19 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener // constants - for (Map<StringName, SL::ShaderNode::Constant>::Element *E = snode->constants.front(); E; E = E->next()) { + for (int i = 0; i < snode->vconstants.size(); i++) { + const SL::ShaderNode::Constant &cnode = snode->vconstants[i]; String gcode; gcode += "const "; - gcode += _prestr(E->get().precision); - if (E->get().type == SL::TYPE_STRUCT) { - gcode += _mkid(E->get().type_str); + gcode += _prestr(cnode.precision); + if (cnode.type == SL::TYPE_STRUCT) { + gcode += _mkid(cnode.type_str); } else { - gcode += _typestr(E->get().type); + gcode += _typestr(cnode.type); } - gcode += " " + _mkid(E->key()); + gcode += " " + _mkid(String(cnode.name)); gcode += "="; - gcode += _dump_node_code(E->get().initializer, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + gcode += _dump_node_code(cnode.initializer, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); gcode += ";\n"; vertex_global += gcode; fragment_global += gcode; |