本文整理汇总了C++中TIntermBinary::setType方法的典型用法代码示例。如果您正苦于以下问题:C++ TIntermBinary::setType方法的具体用法?C++ TIntermBinary::setType怎么用?C++ TIntermBinary::setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIntermBinary
的用法示例。
在下文中一共展示了TIntermBinary::setType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TIntermBinary
TIntermBinary *MakeNewBinary(TOperator op, TIntermTyped *left, TIntermTyped *right, const TType &resultType)
{
TIntermBinary *binary = new TIntermBinary(op);
binary->setLeft(left);
binary->setRight(right);
binary->setType(resultType);
return binary;
}
示例2: ASSERT
TIntermBinary *TIntermTraverser::createTempAssignment(TIntermTyped *rightNode)
{
ASSERT(rightNode != nullptr);
TIntermSymbol *tempSymbol = createTempSymbol(rightNode->getType());
TIntermBinary *assignment = new TIntermBinary(EOpAssign);
assignment->setLeft(tempSymbol);
assignment->setRight(rightNode);
assignment->setType(tempSymbol->getType());
return assignment;
}
示例3: createTempVariable
TString ScalarizeVecAndMatConstructorArgs::createTempVariable(TIntermTyped *original)
{
TString tempVarName = "_webgl_tmp_";
if (original->isScalar())
{
tempVarName += "scalar_";
}
else if (original->isVector())
{
tempVarName += "vec_";
}
else
{
ASSERT(original->isMatrix());
tempVarName += "mat_";
}
tempVarName += Str(mTempVarCount).c_str();
mTempVarCount++;
ASSERT(original);
TType type = original->getType();
type.setQualifier(EvqTemporary);
if (mShaderType == GL_FRAGMENT_SHADER &&
type.getBasicType() == EbtFloat &&
type.getPrecision() == EbpUndefined)
{
// We use the highest available precision for the temporary variable
// to avoid computing the actual precision using the rules defined
// in GLSL ES 1.0 Section 4.5.2.
type.setPrecision(mFragmentPrecisionHigh ? EbpHigh : EbpMedium);
}
TIntermBinary *init = new TIntermBinary(EOpInitialize);
TIntermSymbol *symbolNode = new TIntermSymbol(-1, tempVarName, type);
init->setLeft(symbolNode);
init->setRight(original);
init->setType(type);
TIntermAggregate *decl = new TIntermAggregate(EOpDeclaration);
decl->getSequence()->push_back(init);
ASSERT(mSequenceStack.size() > 0);
TIntermSequence &sequence = mSequenceStack.back();
sequence.push_back(decl);
return tempVarName;
}