| 1149 | } |
| 1150 | |
| 1151 | TIntermTyped* TParseContext::handleTypeCast(const TSourceLoc& loc, TType *castType, TIntermTyped *base) |
| 1152 | { |
| 1153 | TIntermTyped *result = base; |
| 1154 | requireExtensions(loc, 1, &E_GL_NV_explicit_typecast, "explicit typecast"); |
| 1155 | if (castType->isScalar() || castType->isVector() || castType->isMatrix() || castType->isReference()) { |
| 1156 | if (base->getAsAggregate() && !base->getAsAggregate()->getSequence().empty() ) { |
| 1157 | warn(loc, "typecast is unary operator and takes only a single expression","",""); |
| 1158 | } |
| 1159 | result = addConstructor(loc, base, *castType); |
| 1160 | } |
| 1161 | else |
| 1162 | error(loc, "type cast has to be either scalar, vector, matrix or buffer reference", "", ""); |
| 1163 | |
| 1164 | |
| 1165 | return result; |
| 1166 | } |
| 1167 | void TParseContext::blockMemberExtensionCheck(const TSourceLoc& loc, const TIntermTyped* base, int member, const TString& memberName) |
| 1168 | { |
| 1169 | // a block that needs extension checking is either 'base', or if arrayed, |
no test coverage detected