当前位置: 首页>>代码示例>>C++>>正文


C++ TIntermSymbol::getTypePointer方法代码示例

本文整理汇总了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 = &current->getActiveOutput();
		current->pushDepth(0);
		current->setActiveOutput(&ss);
		right->getAsTyped()->traverse(this);
		current->setActiveOutput(oldOut);
		current->popDepth();
		
		sym->setInitializer(ss.str());
	}

   return true;
}
开发者ID:jims,项目名称:hlsl2glslfork,代码行数:49,代码来源:glslOutput.cpp

示例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;
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:13,代码来源:IntermTraverse.cpp

示例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;
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:17,代码来源:IntermTraverse.cpp

示例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;
}
开发者ID:theomission,项目名称:kfx,代码行数:17,代码来源:Parser.cpp


注:本文中的TIntermSymbol::getTypePointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。