diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2020-03-14 11:42:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-14 11:42:45 +0300 |
commit | 750d7ea359a25aa49a086f7b906951201b1c819e (patch) | |
tree | d72473d52c08f28c8af0cb8e857ca8e032bf2552 /servers/visual | |
parent | f65781fe7fa9a421a0ed39e8006f5e5247050758 (diff) | |
parent | 7a2c6a8c0e48f04e30dae753a3b3023f27ad3f39 (diff) |
Merge pull request #37040 from Chaosus/shader_out
Enables passing out built-in parameter from parent function in shaders
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/shader_language.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 8cd0dc7937..e32e7c093a 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2198,6 +2198,14 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p valid = true; break; } + if (b->parent_function) { + for (int i = 0; i < b->parent_function->arguments.size(); i++) { + if (b->parent_function->arguments[i].name == var_name) { + valid = true; + break; + } + } + } b = b->parent_block; } |