本文整理汇总了C++中TIntermTyped::getQualifier方法的典型用法代码示例。如果您正苦于以下问题:C++ TIntermTyped::getQualifier方法的具体用法?C++ TIntermTyped::getQualifier怎么用?C++ TIntermTyped::getQualifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIntermTyped
的用法示例。
在下文中一共展示了TIntermTyped::getQualifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validateIndexing
bool ValidateLimitations::validateIndexing(TIntermBinary *node)
{
ASSERT((node->getOp() == EOpIndexDirect) ||
(node->getOp() == EOpIndexIndirect));
bool valid = true;
TIntermTyped *index = node->getRight();
// The index expression must have integral type.
if (!index->isScalarInt()) {
error(index->getLine(),
"Index expression must have integral type",
index->getCompleteString().c_str());
valid = false;
}
// The index expession must be a constant-index-expression unless
// the operand is a uniform in a vertex shader.
TIntermTyped *operand = node->getLeft();
bool skip = (mShaderType == GL_VERTEX_SHADER) &&
(operand->getQualifier() == EvqUniform);
if (!skip && !isConstIndexExpr(index))
{
error(index->getLine(), "Index expression must be constant", "[]");
valid = false;
}
return valid;
}
示例2: promoteTernary
bool TIntermSelection::promoteTernary(TInfoSink& infoSink)
{
if (!condition->isVector())
return true;
int size = condition->getRowsCount();
TIntermTyped* trueb = trueBlock->getAsTyped();
TIntermTyped* falseb = falseBlock->getAsTyped();
if (!trueb || !falseb)
return false;
if (trueb->getRowsCount() == size && falseb->getRowsCount() == size)
return true;
// Base assumption: just make the type a float vector
TPrecision higherPrecision = GetHigherPrecision(trueb->getPrecision(), falseb->getPrecision());
setType(TType(EbtFloat, higherPrecision, EvqTemporary, 1, size, condition->isMatrix()));
TOperator convert = EOpNull;
{
convert = TOperator( EOpConstructVec2 + size - 2);
TIntermAggregate *node = new TIntermAggregate(convert);
node->setLine(trueb->getLine());
node->setType(TType(condition->getBasicType(), higherPrecision, trueb->getQualifier() == EvqConst ? EvqConst : EvqTemporary, 1, size, condition->isMatrix()));
node->getNodes().push_back(trueb);
trueBlock = node;
}
{
convert = TOperator( EOpConstructVec2 + size - 2);
TIntermAggregate *node = new TIntermAggregate(convert);
node->setLine(falseb->getLine());
node->setType(TType(condition->getBasicType(), higherPrecision, falseb->getQualifier() == EvqConst ? EvqConst : EvqTemporary, 1, size, condition->isMatrix()));
node->getNodes().push_back(falseb);
falseBlock = node;
}
return true;
}