diff options
Diffstat (limited to 'servers/visual/rasterizer_rd/shader_compiler_rd.cpp')
-rw-r--r-- | servers/visual/rasterizer_rd/shader_compiler_rd.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/servers/visual/rasterizer_rd/shader_compiler_rd.cpp b/servers/visual/rasterizer_rd/shader_compiler_rd.cpp index 1aa48a82fc..4572345334 100644 --- a/servers/visual/rasterizer_rd/shader_compiler_rd.cpp +++ b/servers/visual/rasterizer_rd/shader_compiler_rd.cpp @@ -366,7 +366,7 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge r_gen_code.fragment_global += ucode; GeneratedCode::Texture texture; - texture.name = _mkid(E->key()); + texture.name = E->key(); texture.hint = E->get().hint; texture.type = E->get().type; texture.filter = E->get().filter; @@ -452,6 +452,8 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge } #endif + uint32_t index = p_default_actions.base_varying_index; + for (Map<StringName, SL::ShaderNode::Varying>::Element *E = pnode->varyings.front(); E; E = E->next()) { String vcode; @@ -460,8 +462,9 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge vcode += _typestr(E->get().type); vcode += " " + _mkid(E->key()); vcode += ";\n"; - r_gen_code.vertex_global += interp_mode + "out " + vcode; - r_gen_code.fragment_global += interp_mode + "in " + vcode; + r_gen_code.vertex_global += "layout(location=" + itos(index) + ") " + interp_mode + "out " + vcode; + r_gen_code.fragment_global += "layout(location=" + itos(index) + ") " + interp_mode + "in " + vcode; + index++; } for (Map<StringName, SL::ShaderNode::Constant>::Element *E = pnode->constants.front(); E; E = E->next()) { |