From 3cbd8ef09806cc595633f6d8092029e63858579a Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 13 Dec 2021 21:19:13 +0300 Subject: Fix shader crash when assigned array from struct to a variable by index --- servers/rendering/shader_language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'servers/rendering') diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 6681af2594..b1fe15e702 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -576,7 +576,7 @@ public: virtual DataType get_datatype() const override { return datatype; } virtual String get_datatype_name() const override { return String(struct_name); } - virtual int get_array_size() const override { return array_size; } + virtual int get_array_size() const override { return (index_expression || call_expression) ? 0 : array_size; } virtual bool is_indexed() const override { return index_expression != nullptr || call_expression != nullptr; } MemberNode() : -- cgit v1.2.3