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

Method integerCheck

glslang/MachineIndependent/ParseHelper.cpp:4244–4253  ·  view source on GitHub ↗

Both test, and if necessary spit out an error, to see if the node is really a 32-bit integer or can implicitly convert to one.

Source from the content-addressed store, hash-verified

4242// a 32-bit integer or can implicitly convert to one.
4243//
4244void TParseContext::integerCheck(const TIntermTyped* node, const char* token)
4245{
4246 auto from_type = node->getBasicType();
4247 if ((from_type == EbtInt || from_type == EbtUint ||
4248 intermediate.canImplicitlyPromote(from_type, EbtInt, EOpNull) ||
4249 intermediate.canImplicitlyPromote(from_type, EbtUint, EOpNull)) && node->isScalar())
4250 return;
4251
4252 error(node->getLoc(), "scalar integer expression required", token, "");
4253}
4254
4255//
4256// Both test, and if necessary spit out an error, to see if the node is really

Callers 1

yyparseFunction · 0.45

Calls 4

errorFunction · 0.85
canImplicitlyPromoteMethod · 0.80
getBasicTypeMethod · 0.45
isScalarMethod · 0.45

Tested by

no test coverage detected