MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / handleTypeCast

Method handleTypeCast

glslang/MachineIndependent/ParseHelper.cpp:1151–1166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1149}
1150
1151TIntermTyped* 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}
1167void 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,

Callers 1

yyparseFunction · 0.80

Calls 7

errorFunction · 0.85
isScalarMethod · 0.45
isVectorMethod · 0.45
isMatrixMethod · 0.45
isReferenceMethod · 0.45
getAsAggregateMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected