diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2022-01-18 14:13:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 14:13:56 +0300 |
commit | 366d3930ac96db5561afd23b1063085fccf6dcd6 (patch) | |
tree | a4c384e28f2dddf5f35b93fd0ffa8497dc4b5265 /servers/rendering/shader_language.h | |
parent | 567b600362f9625c1916a94e386667ae3df9a4aa (diff) | |
parent | 36a82c8c69a973f159408c08e7cf5e7e3a4c397e (diff) |
Merge pull request #56893 from Chaosus/shader_unify_vardecl
Diffstat (limited to 'servers/rendering/shader_language.h')
-rw-r--r-- | servers/rendering/shader_language.h | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 74f97319fe..c619934182 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -362,7 +362,6 @@ public: TYPE_CONTROL_FLOW, TYPE_MEMBER, TYPE_ARRAY, - TYPE_ARRAY_DECLARATION, TYPE_ARRAY_CONSTRUCT, TYPE_STRUCT, }; @@ -428,7 +427,10 @@ public: struct Declaration { StringName name; - Node *initializer; + uint32_t size = 0U; + Node *size_expression = nullptr; + Vector<Node *> initializer; + bool single_expression = false; }; Vector<Declaration> declarations; @@ -471,27 +473,6 @@ public: Node(TYPE_ARRAY_CONSTRUCT) {} }; - struct ArrayDeclarationNode : public Node { - DataPrecision precision = PRECISION_DEFAULT; - DataType datatype = TYPE_VOID; - String struct_name; - bool is_const = false; - Node *size_expression = nullptr; - - struct Declaration { - StringName name; - uint32_t size; - Vector<Node *> initializer; - bool single_expression; - }; - Vector<Declaration> declarations; - - virtual DataType get_datatype() const override { return datatype; } - - ArrayDeclarationNode() : - Node(TYPE_ARRAY_DECLARATION) {} - }; - struct ConstantNode : public Node { DataType datatype = TYPE_VOID; String struct_name = ""; @@ -505,7 +486,7 @@ public: }; Vector<Value> values; - Vector<ArrayDeclarationNode::Declaration> array_declarations; + Vector<VariableDeclarationNode::Declaration> array_declarations; virtual DataType get_datatype() const override { return datatype; } virtual String get_datatype_name() const override { return struct_name; } |