summaryrefslogtreecommitdiff
path: root/servers/visual
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-02-22 11:09:06 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2020-03-14 10:46:27 +0300
commit7a2c6a8c0e48f04e30dae753a3b3023f27ad3f39 (patch)
treed72473d52c08f28c8af0cb8e857ca8e032bf2552 /servers/visual
parentf65781fe7fa9a421a0ed39e8006f5e5247050758 (diff)
Enables passing out built-in parameter from parent function in shaders
Diffstat (limited to 'servers/visual')
-rw-r--r--servers/visual/shader_language.cpp8
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;
}