diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-11-26 10:49:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 10:49:52 +0100 |
commit | 9f50cbc6ed1af40278f3d62c5e05ff1384738fca (patch) | |
tree | ead8849331bd26a8e3c3090bd80843ed33e1c828 /servers | |
parent | 3747909fd4682d527767c8dbbeea37099f756175 (diff) | |
parent | 33a7fae1275ed17b6799c5bee5dfdb538ec9b8fe (diff) |
Merge pull request #23949 from Kanabenki/shader-mul-assign-vec-mat
Allow *= operator between vec and mat types in shaders
Diffstat (limited to 'servers')
-rw-r--r-- | servers/visual/shader_language.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 50e45963d9..1acec7ccaf 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: |