1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Merge pull request #37795 from Chaosus/shader_fix_const_order2

Fix shader constant sorting
This commit is contained in:
Rémi Verschelde
2020-04-29 09:41:34 +02:00
committed by GitHub
4 changed files with 21 additions and 14 deletions

View File

@@ -6334,6 +6334,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
while (true) {
ShaderNode::Constant constant;
constant.name = name;
constant.type = is_struct ? TYPE_STRUCT : type;
constant.type_str = struct_name;
constant.precision = precision;
@@ -6373,6 +6374,8 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
}
shader->constants[name] = constant;
shader->vconstants.push_back(constant);
if (tk.type == TK_COMMA) {
tk = _get_token();
if (tk.type != TK_IDENTIFIER) {