Merge pull request #23949 from Kanabenki/shader-mul-assign-vec-mat

Allow *= operator between vec and mat types in shaders
This commit is contained in:
Rémi Verschelde 2018-11-26 10:49:52 +01:00 committed by GitHub
commit 9f50cbc6ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -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: