Merge pull request #28829 from vreon/swizzle-up

Allow constructing larger data types by swizzling
This commit is contained in:
Rémi Verschelde 2019-05-24 17:02:26 +02:00 committed by GitHub
commit 193837a8f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2968,6 +2968,10 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
member_type = DataType(dt - 1);
} else if (l == 2) {
member_type = dt;
} else if (l == 3) {
member_type = DataType(dt + 1);
} else if (l == 4) {
member_type = DataType(dt + 2);
} else {
ok = false;
break;
@ -3001,6 +3005,8 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
member_type = DataType(dt - 1);
} else if (l == 3) {
member_type = dt;
} else if (l == 4) {
member_type = DataType(dt + 1);
} else {
ok = false;
break;