You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Force user to initialize local shader constants
This commit is contained in:
@@ -4022,6 +4022,10 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
|
|||||||
_set_error("Expected array initialization");
|
_set_error("Expected array initialization");
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
if (is_const) {
|
||||||
|
_set_error("Expected initialization of constant");
|
||||||
|
return ERR_PARSE_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node->declarations.push_back(decl);
|
node->declarations.push_back(decl);
|
||||||
@@ -4051,6 +4055,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
|
|||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
node->declarations.push_back(decl);
|
node->declarations.push_back(decl);
|
||||||
} else {
|
} else {
|
||||||
|
if (is_const) {
|
||||||
|
_set_error("Expected initialization of constant");
|
||||||
|
return ERR_PARSE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
VariableDeclarationNode *node = alloc_node<VariableDeclarationNode>();
|
VariableDeclarationNode *node = alloc_node<VariableDeclarationNode>();
|
||||||
node->datatype = type;
|
node->datatype = type;
|
||||||
node->precision = precision;
|
node->precision = precision;
|
||||||
|
|||||||
Reference in New Issue
Block a user