diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-08-13 10:37:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-13 10:37:53 +0300 |
commit | eadf9d92f97329d85f88dce1a6f8ea6866bf191b (patch) | |
tree | a0d57d154003c7fddd9100a2f001d9d00c3c9d8d /servers/rendering/renderer_rd | |
parent | af70288ee086493b3ab3df9c0e03c47ec07a19e8 (diff) | |
parent | fa96c98bdf7a4ec3a97a6f99dea37a98c2c77f35 (diff) |
Merge pull request #51609 from Chaosus/shader_fix_varying_error
Fix shader crash when using local var with the same name as varying
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r-- | servers/rendering/renderer_rd/shader_compiler_rd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/shader_compiler_rd.cpp b/servers/rendering/renderer_rd/shader_compiler_rd.cpp index 9c1068ea2e..8aa03b6426 100644 --- a/servers/rendering/renderer_rd/shader_compiler_rd.cpp +++ b/servers/rendering/renderer_rd/shader_compiler_rd.cpp @@ -887,7 +887,7 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge SL::VariableNode *vnode = (SL::VariableNode *)p_node; bool use_fragment_varying = false; - if (!(p_actions.entry_point_stages.has(current_func_name) && p_actions.entry_point_stages[current_func_name] == STAGE_VERTEX)) { + if (!vnode->is_local && !(p_actions.entry_point_stages.has(current_func_name) && p_actions.entry_point_stages[current_func_name] == STAGE_VERTEX)) { if (p_assigning) { if (shader->varyings.has(vnode->name)) { use_fragment_varying = true; @@ -1037,7 +1037,7 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge SL::ArrayNode *anode = (SL::ArrayNode *)p_node; bool use_fragment_varying = false; - if (!(p_actions.entry_point_stages.has(current_func_name) && p_actions.entry_point_stages[current_func_name] == STAGE_VERTEX)) { + if (!anode->is_local && !(p_actions.entry_point_stages.has(current_func_name) && p_actions.entry_point_stages[current_func_name] == STAGE_VERTEX)) { if (anode->assign_expression != nullptr && shader->varyings.has(anode->name)) { use_fragment_varying = true; } else { |