summaryrefslogtreecommitdiff
path: root/servers/rendering/shader_language.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-15 16:19:22 +0200
committerGitHub <noreply@github.com>2021-07-15 16:19:22 +0200
commit64fb4fac89ddc51f35a3e727783f4f40dc9eca8f (patch)
tree7c585aa20c41ae40830e6d40aa328f6a962fada0 /servers/rendering/shader_language.h
parent3f12765a7e3489d1d3b687c84efbfcab58442bc9 (diff)
parent5100eed012eb22f4717a124d23be90fca21d6174 (diff)
Merge pull request #49996 from Chaosus/shader_localvar_warning
Added a shader warning about unused local variable
Diffstat (limited to 'servers/rendering/shader_language.h')
-rw-r--r--servers/rendering/shader_language.h5
1 files changed, 4 insertions, 1 deletions
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<StringName, Usage> used_structs;
Map<ShaderWarning::Code, Map<StringName, Usage> *> warnings_check_map;
+ Map<StringName, Map<StringName, Usage>> used_local_vars;
+ Map<ShaderWarning::Code, Map<StringName, Map<StringName, Usage>> *> warnings_check_map2;
+
List<ShaderWarning> 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);