summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-06-25 11:10:59 +0300
committerGitHub <noreply@github.com>2020-06-25 11:10:59 +0300
commitf1d7bb6b368e972717849ba697419b6ab40e53f4 (patch)
tree00dd971e8d146b10f2262c0f36a429103a7696de
parent4dede9e644d480c83dfdbb2c3d3b423b075ef64e (diff)
parentb6ca9536f2635430cc157497b4fc2298f9809dc2 (diff)
Merge pull request #39822 from Chaosus/shader_fix_const_pass
Fix few places in shaders where const passing still incorrect
-rw-r--r--servers/rendering/shader_language.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index a3fef10cc0..14a28554f9 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -3560,7 +3560,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
error = true;
} else if (n->type == Node::TYPE_ARRAY) {
ArrayNode *an = static_cast<ArrayNode *>(n);
- if (an->call_expression != nullptr) {
+ if (an->call_expression != nullptr || an->is_const) {
error = true;
}
} else if (n->type == Node::TYPE_VARIABLE) {
@@ -3569,7 +3569,9 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
error = true;
} else {
StringName varname = vn->name;
- if (shader->uniforms.has(varname)) {
+ if (shader->constants.has(varname)) {
+ error = true;
+ } else if (shader->uniforms.has(varname)) {
error = true;
} else {
if (p_builtin_types.has(varname)) {