Fix shader's length() function parsing in expressions
This commit is contained in:
parent
dc67d0737b
commit
1a7e101324
4 changed files with 19 additions and 9 deletions
|
|
@ -262,7 +262,7 @@ void ShaderCompilerGLES2::_dump_function_deps(SL::ShaderNode *p_node, const Stri
|
|||
}
|
||||
}
|
||||
|
||||
String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, GeneratedCode &r_gen_code, IdentifierActions &p_actions, const DefaultIdentifierActions &p_default_actions, bool p_assigning) {
|
||||
String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, GeneratedCode &r_gen_code, IdentifierActions &p_actions, const DefaultIdentifierActions &p_default_actions, bool p_assigning, bool p_use_scope) {
|
||||
StringBuilder code;
|
||||
|
||||
switch (p_node->type) {
|
||||
|
|
@ -626,7 +626,7 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
|
|||
|
||||
if (arr_node->call_expression != nullptr) {
|
||||
code += ".";
|
||||
code += _dump_node_code(arr_node->call_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += _dump_node_code(arr_node->call_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning, false);
|
||||
}
|
||||
|
||||
if (arr_node->index_expression != nullptr) {
|
||||
|
|
@ -822,13 +822,17 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
|
|||
} break;
|
||||
|
||||
default: {
|
||||
code += "(";
|
||||
if (p_use_scope) {
|
||||
code += "(";
|
||||
}
|
||||
code += _dump_node_code(op_node->arguments[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += " ";
|
||||
code += _opstr(op_node->op);
|
||||
code += " ";
|
||||
code += _dump_node_code(op_node->arguments[1], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += ")";
|
||||
if (p_use_scope) {
|
||||
code += ")";
|
||||
}
|
||||
} break;
|
||||
}
|
||||
} break;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ private:
|
|||
};
|
||||
|
||||
void _dump_function_deps(ShaderLanguage::ShaderNode *p_node, const StringName &p_for_func, const Map<StringName, String> &p_func_code, StringBuilder &r_to_add, Set<StringName> &r_added);
|
||||
String _dump_node_code(ShaderLanguage::Node *p_node, int p_level, GeneratedCode &r_gen_code, IdentifierActions &p_actions, const DefaultIdentifierActions &p_default_actions, bool p_assigning);
|
||||
String _dump_node_code(ShaderLanguage::Node *p_node, int p_level, GeneratedCode &r_gen_code, IdentifierActions &p_actions, const DefaultIdentifierActions &p_default_actions, bool p_assigning, bool p_use_scope = true);
|
||||
|
||||
StringName current_func_name;
|
||||
StringName vertex_name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue