本文整理汇总了C++中TIntermSymbol::getTypePointer方法的典型用法代码示例。如果您正苦于以下问题:C++ TIntermSymbol::getTypePointer方法的具体用法?C++ TIntermSymbol::getTypePointer怎么用?C++ TIntermSymbol::getTypePointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIntermSymbol
的用法示例。
在下文中一共展示了TIntermSymbol::getTypePointer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseInitializer
bool TGlslOutputTraverser::parseInitializer( TIntermBinary *node )
{
TIntermTyped *left, *right;
left = node->getLeft();
right = node->getRight();
if (!left->getAsSymbolNode())
return false; //Something is likely seriously wrong
TIntermSymbol *symNode = left->getAsSymbolNode();
if (symNode->getBasicType() == EbtStruct)
return false;
GlslSymbol * sym = NULL;
if ( !current->hasSymbol( symNode->getId() ) )
{
int array = symNode->getTypePointer()->isArray() ? symNode->getTypePointer()->getArraySize() : 0;
const char* semantic = "";
if (symNode->getInfo())
semantic = symNode->getInfo()->getSemantic().c_str();
sym = new GlslSymbol( symNode->getSymbol().c_str(), semantic, symNode->getId(),
translateType(symNode->getTypePointer()), m_UsePrecision?node->getPrecision():EbpUndefined, translateQualifier(symNode->getQualifier()), array);
current->addSymbol(sym);
}
else
return false; //can't init already declared variable
if (right->getAsTyped())
{
std::stringstream ss;
std::stringstream* oldOut = ¤t->getActiveOutput();
current->pushDepth(0);
current->setActiveOutput(&ss);
right->getAsTyped()->traverse(this);
current->setActiveOutput(oldOut);
current->popDepth();
sym->setInitializer(ss.str());
}
return true;
}
示例2: ASSERT
TIntermSymbol *TIntermTraverser::createTempSymbol(const TType &type, TQualifier qualifier)
{
// Each traversal uses at most one temporary variable, so the index stays the same within a single traversal.
TInfoSinkBase symbolNameOut;
ASSERT(mTemporaryIndex != nullptr);
symbolNameOut << "s" << (*mTemporaryIndex);
TString symbolName = symbolNameOut.c_str();
TIntermSymbol *node = new TIntermSymbol(0, symbolName, type);
node->setInternal(true);
node->getTypePointer()->setQualifier(qualifier);
return node;
}
示例3: ASSERT
TIntermSymbol *TIntermTraverser::createTempSymbol(const TType &type, TQualifier qualifier)
{
// Each traversal uses at most one temporary variable, so the index stays the same within a single traversal.
TInfoSinkBase symbolNameOut;
ASSERT(mTemporaryIndex != nullptr);
symbolNameOut << "s" << (*mTemporaryIndex);
TString symbolName = symbolNameOut.c_str();
TIntermSymbol *node = new TIntermSymbol(0, symbolName, type);
node->setInternal(true);
ASSERT(qualifier == EvqTemporary || qualifier == EvqConst || qualifier == EvqGlobal);
node->getTypePointer()->setQualifier(qualifier);
// TODO(oetuaho): Might be useful to sanitize layout qualifier etc. on the type of the created
// symbol. This might need to be done in other places as well.
return node;
}
示例4: buildShader
ParsedCode Parser::buildShader(TIntermAggregate* f) {
cur.pos = f->getLine().first_line;
cur.args.clear();
cur.exprs.clear();
Position pos = f->getLine().first_line;
TIntermSequence& sequence = f->getSequence();
TIntermSequence& arguments = sequence[0]->getAsAggregate()->getSequence();
for (auto it = arguments.begin(); it != arguments.end(); ++it) {
TIntermSymbol* symbol = (*it)->getAsSymbolNode();
//if (symbol->getType().getStruct()) {
// addConstructor(symbol->getType(), scopedStruct(symbol->getType().getTypeName()), NULL);
//}
cur.args.push_back(allocVar(symbol->getQualifierString(), symbol->getTypePointer(), VUnknown, pos));
}
parseExpr(sequence[1]->getAsAggregate()->getSequence());
return cur;
}