Merge pull request #39822 from Chaosus/shader_fix_const_pass

Fix few places in shaders where const passing still incorrect
This commit is contained in:
Yuri Roubinsky 2020-06-25 11:10:59 +03:00 committed by GitHub
commit f1d7bb6b36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)) {