summaryrefslogtreecommitdiff
path: root/servers/rendering/shader_language.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/rendering/shader_language.h')
-rw-r--r--servers/rendering/shader_language.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h
index 9d2d591542..27767378f9 100644
--- a/servers/rendering/shader_language.h
+++ b/servers/rendering/shader_language.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -414,6 +414,7 @@ public:
StringName name;
Node *index_expression = nullptr;
Node *call_expression = nullptr;
+ Node *assign_expression = nullptr;
bool is_const = false;
virtual DataType get_datatype() const { return datatype_cache; }
@@ -437,6 +438,7 @@ public:
DataType datatype = TYPE_VOID;
String struct_name;
bool is_const = false;
+ Node *size_expression = nullptr;
struct Declaration {
StringName name;
@@ -496,6 +498,7 @@ public:
int line; //for completion
int array_size;
bool is_const;
+ ConstantNode::Value value;
};
Map<StringName, Variable> variables;
@@ -526,6 +529,7 @@ public:
StringName name;
Node *owner = nullptr;
Node *index_expression = nullptr;
+ Node *assign_expression = nullptr;
bool has_swizzling_duplicates = false;
virtual DataType get_datatype() const { return datatype; }
@@ -774,6 +778,7 @@ private:
int tk_line;
StringName current_function;
+ bool last_const = false;
struct TkPos {
int char_idx;
@@ -819,7 +824,7 @@ private:
IDENTIFIER_CONSTANT,
};
- 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);
+ 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);
bool _is_operator_assign(Operator p_op) const;
bool _validate_assign(Node *p_node, const FunctionInfo &p_function_info, String *r_message = nullptr);
bool _validate_operator(OperatorNode *p_op, DataType *r_ret_type = nullptr);
@@ -861,6 +866,7 @@ private:
bool _propagate_function_call_sampler_builtin_reference(StringName p_name, int p_argument, const StringName &p_builtin);
Node *_parse_expression(BlockNode *p_block, const FunctionInfo &p_function_info);
+ Node *_parse_array_constructor(BlockNode *p_block, const FunctionInfo &p_function_info, DataType p_type, const StringName &p_struct_name, int p_array_size);
ShaderLanguage::Node *_reduce_expression(BlockNode *p_block, ShaderLanguage::Node *p_node);
Node *_parse_and_reduce_expression(BlockNode *p_block, const FunctionInfo &p_function_info);