From 5100eed012eb22f4717a124d23be90fca21d6174 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Tue, 29 Jun 2021 14:34:54 +0300 Subject: Added a shader warning about unused local variable --- servers/rendering/shader_language.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'servers/rendering/shader_language.h') diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 4120e04ee1..a91fa57a8e 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -848,6 +848,9 @@ private: Map used_structs; Map *> warnings_check_map; + Map> used_local_vars; + Map> *> warnings_check_map2; + List warnings; bool check_warnings = false; @@ -917,7 +920,7 @@ private: bool _find_identifier(const BlockNode *p_block, bool p_allow_reassign, const FunctionInfo &p_function_info, const StringName &p_identifier, DataType *r_data_type = nullptr, IdentifierType *r_type = nullptr, bool *r_is_const = nullptr, int *r_array_size = nullptr, StringName *r_struct_name = nullptr, ConstantNode::Value *r_constant_value = nullptr); #ifdef DEBUG_ENABLED - void _parse_used_identifier(const StringName &p_identifier, IdentifierType p_type); + void _parse_used_identifier(const StringName &p_identifier, IdentifierType p_type, const StringName &p_function); #endif // DEBUG_ENABLED bool _is_operator_assign(Operator p_op) const; bool _validate_assign(Node *p_node, const FunctionInfo &p_function_info, String *r_message = nullptr); -- cgit v1.2.3