diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2020-07-15 08:49:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-15 08:49:59 +0300 |
commit | 1a5cafebc9f33ed514ec8d02be25c73ef4dd5c40 (patch) | |
tree | 814d7784f116c1d400e4a96ef21bd342fd071b3d /servers/rendering | |
parent | 3ed5ff244f679da590d360b38e35adcdcb0aeaf7 (diff) | |
parent | 01950553f2c934a992fc8cf75d2cf1a53abbbd18 (diff) |
Merge pull request #40389 from Chaosus/fix_shader
Fix some incorrect conversions which lead to crash in shaders
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/shader_language.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index b903951400..535011710d 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -1137,13 +1137,13 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type } else if (na == TYPE_FLOAT && nb == TYPE_VEC4) { valid = true; ret_type = TYPE_VEC4; - } else if (p_op->op == OP_MUL && na == TYPE_FLOAT && nb == TYPE_MAT2) { + } else if (na == TYPE_FLOAT && nb == TYPE_MAT2) { valid = true; ret_type = TYPE_MAT2; - } else if (p_op->op == OP_MUL && na == TYPE_FLOAT && nb == TYPE_MAT3) { + } else if (na == TYPE_FLOAT && nb == TYPE_MAT3) { valid = true; ret_type = TYPE_MAT3; - } else if (p_op->op == OP_MUL && na == TYPE_FLOAT && nb == TYPE_MAT4) { + } else if (na == TYPE_FLOAT && nb == TYPE_MAT4) { valid = true; ret_type = TYPE_MAT4; } else if (p_op->op == OP_MUL && na == TYPE_VEC2 && nb == TYPE_MAT2) { @@ -1313,13 +1313,13 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type } else if (na == TYPE_VEC4 && nb == TYPE_FLOAT) { valid = true; ret_type = TYPE_VEC4; - } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_MAT2 && nb == TYPE_VEC2) { + } else if (na == TYPE_MAT2 && nb == TYPE_FLOAT) { valid = true; ret_type = TYPE_MAT2; - } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_MAT3 && nb == TYPE_VEC3) { + } else if (na == TYPE_MAT3 && nb == TYPE_FLOAT) { valid = true; ret_type = TYPE_MAT3; - } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_MAT4 && nb == TYPE_VEC4) { + } else if (na == TYPE_MAT4 && nb == TYPE_FLOAT) { valid = true; ret_type = TYPE_MAT4; } else if (p_op->op == OP_ASSIGN_MUL && na == TYPE_VEC2 && nb == TYPE_MAT2) { |