From 33a7fae1275ed17b6799c5bee5dfdb538ec9b8fe Mon Sep 17 00:00:00 2001 From: Kanabenki <18357657+Kanabenki@users.noreply.github.com> Date: Sat, 24 Nov 2018 18:57:11 +0100 Subject: [PATCH] Allow *= operator between vec and mat types in shaders --- servers/visual/shader_language.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 50e45963d9f..1acec7ccaf8 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1215,6 +1215,15 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_MAT4 && nb == TYPE_VEC4) { valid = true; ret_type = TYPE_MAT4; + } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_VEC2 && nb == TYPE_MAT2) { + valid = true; + ret_type = TYPE_VEC2; + } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_VEC3 && nb == TYPE_MAT3) { + valid = true; + ret_type = TYPE_VEC3; + } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_VEC4 && nb == TYPE_MAT4) { + valid = true; + ret_type = TYPE_VEC4; } } break; case OP_ASSIGN_BIT_AND: