本文整理汇总了C++中OutputTreeText函数的典型用法代码示例。如果您正苦于以下问题:C++ OutputTreeText函数的具体用法?C++ OutputTreeText怎么用?C++ OutputTreeText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OutputTreeText函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OutputConstantUnion
void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion, int depth)
{
int size = node->getType().computeNumComponents();
for (int i = 0; i < size; i++) {
OutputTreeText(out, node, depth);
switch (constUnion[i].getType()) {
case EbtBool:
if (constUnion[i].getBConst())
out.debug << "true";
else
out.debug << "false";
out.debug << " (" << "const bool" << ")";
out.debug << "\n";
break;
case EbtFloat:
case EbtDouble:
{
const double value = constUnion[i].getDConst();
// Print infinity in a portable way, for test stability.
// Other cases may be needed in the future: negative infinity,
// and NaNs.
if (is_positive_infinity(value))
out.debug << "inf\n";
else {
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%f", value);
out.debug << buf << "\n";
}
}
break;
case EbtInt:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int");
out.debug << buf << "\n";
}
break;
case EbtUint:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint");
out.debug << buf << "\n";
}
break;
default:
out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
break;
}
}
}
开发者ID:Marqin,项目名称:glslang,代码行数:59,代码来源:intermOut.cpp
示例2: OutputTreeText
bool TOutputTraverser::visitLoop(Visit visit, TIntermLoop *node)
{
TInfoSinkBase &out = sink;
OutputTreeText(out, node, mDepth);
out << "Loop with condition ";
if (node->getType() == ELoopDoWhile)
out << "not ";
out << "tested first\n";
++mDepth;
OutputTreeText(sink, node, mDepth);
if (node->getCondition())
{
out << "Loop Condition\n";
node->getCondition()->traverse(this);
}
else
{
out << "No loop condition\n";
}
OutputTreeText(sink, node, mDepth);
if (node->getBody())
{
out << "Loop Body\n";
node->getBody()->traverse(this);
}
else
{
out << "No loop body\n";
}
if (node->getExpression())
{
OutputTreeText(sink, node, mDepth);
out << "Loop Terminal Expression\n";
node->getExpression()->traverse(this);
}
--mDepth;
return false;
}
开发者ID:merckhung,项目名称:libui,代码行数:46,代码来源:intermOut.cpp
示例3: OutputCase
bool OutputCase(bool /* preVisit */, TIntermCase* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
out.debug << "Case";
out.debug << " (" << node->getCompleteString() << ")";
OutputDebugText(out, node);
out.debug << "\n";
#if DEBUG_SCOPE == 1
OutputScopeText(oit->infoSink, node, oit->depth);
#endif
#if DEBUG_CHANGEABLE == 1
OutputChangeableText(oit->infoSink, node, oit->depth, 0);
#endif
++oit->depth;
if (node->getExpression()) {
node->getExpression()->traverse(it);
} else {
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
out.debug << "Default Case\n" ;
}
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
out.debug << "Body\n";
++oit->depth;
if (node->getCaseBody()) {
node->getCaseBody()->traverse(it);
}
--oit->depth;
--oit->depth;
return false;
}
开发者ID:jtorresfabra,项目名称:GLSL-Debugger,代码行数:45,代码来源:intermOut.cpp
示例4: OutputTreeText
void TOutputTraverser::visitSymbol(TIntermSymbol* node)
{
OutputTreeText(infoSink, node, depth);
infoSink.debug << "'" << node->getName() << "' (" << node->getCompleteString() << ")\n";
if (! node->getConstArray().empty())
OutputConstantUnion(infoSink, node, node->getConstArray(), depth + 1);
}
开发者ID:Stretto,项目名称:renderdoc,代码行数:9,代码来源:intermOut.cpp
示例5: OutputSwitch
bool OutputSwitch(bool /* preVisit */, TIntermSwitch* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
out.debug << "Test condition and switch";
out.debug << " (" << node->getCompleteString() << ")";
OutputDebugText(out, node);
out.debug << " <<";
out.debug << getDbgSelectionStatus(node->getDbgInternalState());
out.debug << ">>\n";
#if DEBUG_SCOPE == 1
OutputScopeText(oit->infoSink, node, oit->depth);
#endif
#if DEBUG_CHANGEABLE == 1
OutputChangeableText(oit->infoSink, node, oit->depth, 0);
#endif
++oit->depth;
OutputExtensionText(out, node);
OutputTreeText(oit->infoSink, node, oit->depth);
out.debug << "Condition\n";
++oit->depth;
node->getCondition()->traverse(it);
--oit->depth;
OutputExtensionText(out, node);
OutputTreeText(oit->infoSink, node, oit->depth);
out.debug << "Case List\n";
++oit->depth;
if (node->getCaseList()) {
node->getCaseList()->traverse(it);
}
--oit->depth;
--oit->depth;
return false;
}
开发者ID:jtorresfabra,项目名称:GLSL-Debugger,代码行数:44,代码来源:intermOut.cpp
示例6: OutputLoop
bool OutputLoop(bool, /* preVisit */ TIntermLoop* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputTreeText(out, node, oit->depth);
out.debug << "Loop with condition ";
if (! node->testFirst())
out.debug << "not ";
out.debug << "tested first\n";
++oit->depth;
OutputTreeText(oit->infoSink, node, oit->depth);
if (node->getTest())
{
out.debug << "Loop Condition\n";
node->getTest()->traverse(it);
}
else
out.debug << "No loop condition\n";
OutputTreeText(oit->infoSink, node, oit->depth);
if (node->getBody())
{
out.debug << "Loop Body\n";
node->getBody()->traverse(it);
}
else
out.debug << "No loop body\n";
if (node->getTerminal())
{
OutputTreeText(oit->infoSink, node, oit->depth);
out.debug << "Loop Terminal Expression\n";
node->getTerminal()->traverse(it);
}
--oit->depth;
return false;
}
开发者ID:CRivlaldo,项目名称:hlsl2glslfork,代码行数:43,代码来源:intermOut.cpp
示例7: OutputFuncDeclaration
void OutputFuncDeclaration(TIntermFuncDeclaration* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
out.debug << "Function Declaration: " <<
node->getFunction()->getMangledName() << "\n" ;
}
开发者ID:jtorresfabra,项目名称:GLSL-Debugger,代码行数:10,代码来源:intermOut.cpp
示例8: OutputSymbol
void OutputSymbol(TIntermSymbol* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
OutputTreeText(oit->infoSink, node, oit->depth);
char buf[100];
sprintf(buf, "'%s' (%s)\n",
node->getSymbol().c_str(),
node->getCompleteString().c_str());
oit->infoSink.debug << buf;
}
开发者ID:CRivlaldo,项目名称:hlsl2glslfork,代码行数:13,代码来源:intermOut.cpp
示例9: OutputConstantUnion
void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion, int depth)
{
int size = node->getType().computeNumComponents();
for (int i = 0; i < size; i++) {
OutputTreeText(out, node, depth);
switch (constUnion[i].getType()) {
case EbtBool:
if (constUnion[i].getBConst())
out.debug << "true";
else
out.debug << "false";
out.debug << " (" << "const bool" << ")";
out.debug << "\n";
break;
case EbtFloat:
case EbtDouble:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%f", constUnion[i].getDConst());
out.debug << buf << "\n";
}
break;
case EbtInt:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int");
out.debug << buf << "\n";
}
break;
case EbtUint:
{
const int maxSize = 300;
char buf[maxSize];
snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint");
out.debug << buf << "\n";
}
break;
default:
out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
break;
}
}
}
开发者ID:TimNN,项目名称:glslang,代码行数:51,代码来源:intermOut.cpp
示例10: OutputTreeText
bool TOutputTraverser::visitBinary(Visit visit, TIntermBinary* node)
{
TInfoSinkBase& out = sink;
OutputTreeText(out, node, depth);
switch (node->getOp()) {
case EOpAssign: out << "move second child to first child"; break;
case EOpInitialize: out << "initialize first child with second child"; break;
case EOpAddAssign: out << "add second child into first child"; break;
case EOpSubAssign: out << "subtract second child into first child"; break;
case EOpMulAssign: out << "multiply second child into first child"; break;
case EOpVectorTimesMatrixAssign: out << "matrix mult second child into first child"; break;
case EOpVectorTimesScalarAssign: out << "vector scale second child into first child"; break;
case EOpMatrixTimesScalarAssign: out << "matrix scale second child into first child"; break;
case EOpMatrixTimesMatrixAssign: out << "matrix mult second child into first child"; break;
case EOpDivAssign: out << "divide second child into first child"; break;
case EOpIndexDirect: out << "direct index"; break;
case EOpIndexIndirect: out << "indirect index"; break;
case EOpIndexDirectStruct: out << "direct index for structure"; break;
case EOpVectorSwizzle: out << "vector swizzle"; break;
case EOpAdd: out << "add"; break;
case EOpSub: out << "subtract"; break;
case EOpMul: out << "component-wise multiply"; break;
case EOpDiv: out << "divide"; break;
case EOpEqual: out << "Compare Equal"; break;
case EOpNotEqual: out << "Compare Not Equal"; break;
case EOpLessThan: out << "Compare Less Than"; break;
case EOpGreaterThan: out << "Compare Greater Than"; break;
case EOpLessThanEqual: out << "Compare Less Than or Equal"; break;
case EOpGreaterThanEqual: out << "Compare Greater Than or Equal"; break;
case EOpVectorTimesScalar: out << "vector-scale"; break;
case EOpVectorTimesMatrix: out << "vector-times-matrix"; break;
case EOpMatrixTimesVector: out << "matrix-times-vector"; break;
case EOpMatrixTimesScalar: out << "matrix-scale"; break;
case EOpMatrixTimesMatrix: out << "matrix-multiply"; break;
case EOpLogicalOr: out << "logical-or"; break;
case EOpLogicalXor: out << "logical-xor"; break;
case EOpLogicalAnd: out << "logical-and"; break;
default: out << "<unknown op>";
}
out << " (" << node->getCompleteString() << ")";
out << "\n";
return true;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:51,代码来源:intermOut.cpp
示例11: OutputTreeText
void TOutputTraverser::visitSymbol(TIntermSymbol* node)
{
OutputTreeText(infoSink, node, depth);
infoSink.debug << "'" << node->getName() << "' (" << node->getCompleteString() << ")\n";
if (! node->getConstArray().empty())
OutputConstantUnion(infoSink, node, node->getConstArray(), depth + 1);
else if (node->getConstSubtree()) {
incrementDepth(node);
node->getConstSubtree()->traverse(this);
decrementDepth();
}
}
开发者ID:Alcaro,项目名称:RetroArch,代码行数:14,代码来源:intermOut.cpp
示例12: OutputTreeText
void TOutputTraverser::visitSymbol(TIntermSymbol* node)
{
OutputTreeText(infoSink, node, depth);
const int maxSize = GlslangMaxTypeLength + GlslangMaxTokenLength;
char buf[maxSize];
snprintf(buf, maxSize, "'%s' (%s)\n",
node->getName().c_str(),
node->getCompleteString().c_str());
infoSink.debug << buf;
if (! node->getConstArray().empty())
OutputConstantUnion(infoSink, node, node->getConstArray(), depth + 1);
}
开发者ID:casseveritt,项目名称:glslang,代码行数:14,代码来源:intermOut.cpp
示例13: OutputSelection
bool OutputSelection(bool, /* preVisit */ TIntermSelection* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputTreeText(out, node, oit->depth);
out.debug << "ternary ?:";
out.debug << " (" << node->getCompleteString() << ")\n";
++oit->depth;
OutputTreeText(oit->infoSink, node, oit->depth);
out.debug << "Condition\n";
node->getCondition()->traverse(it);
OutputTreeText(oit->infoSink, node, oit->depth);
if (node->getTrueBlock())
{
out.debug << "true case\n";
node->getTrueBlock()->traverse(it);
}
else
out.debug << "true case is null\n";
if (node->getFalseBlock())
{
OutputTreeText(oit->infoSink, node, oit->depth);
out.debug << "false case\n";
node->getFalseBlock()->traverse(it);
}
--oit->depth;
return false;
}
开发者ID:CRivlaldo,项目名称:hlsl2glslfork,代码行数:36,代码来源:intermOut.cpp
示例14: OutputTreeText
bool TOutputTraverser::visitIfElse(Visit visit, TIntermIfElse *node)
{
TInfoSinkBase &out = sink;
OutputTreeText(out, node, mDepth);
out << "If test\n";
++mDepth;
OutputTreeText(sink, node, mDepth);
out << "Condition\n";
node->getCondition()->traverse(this);
OutputTreeText(sink, node, mDepth);
if (node->getTrueBlock())
{
out << "true case\n";
node->getTrueBlock()->traverse(this);
}
else
{
out << "true case is null\n";
}
if (node->getFalseBlock())
{
OutputTreeText(sink, node, mDepth);
out << "false case\n";
node->getFalseBlock()->traverse(this);
}
--mDepth;
return false;
}
开发者ID:servo,项目名称:angle,代码行数:36,代码来源:intermOut.cpp
示例15: OutputDummy
void OutputDummy(TIntermDummy* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
out.debug << "dummy ";
OutputDebugText(out, node);
out.debug << "\n";
#if DEBUG_CHANGEABLE == 1
OutputChangeableText(oit->infoSink, node, oit->depth, 0);
#endif
}
开发者ID:jtorresfabra,项目名称:GLSL-Debugger,代码行数:17,代码来源:intermOut.cpp
示例16: OutputFuncParam
void OutputFuncParam(TIntermFuncParam* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
OutputExtensionText(oit->infoSink, node);
OutputTreeText(oit->infoSink, node, oit->depth);
char buf[100];
sprintf(buf, "fparam '%s' (%s)\n",
node->getSymbol().c_str(),
node->getCompleteString().c_str());
oit->infoSink.debug << buf;
#if DEBUG_CHANGEABLE == 1
OutputChangeableText(oit->infoSink, node, oit->depth, 0);
#endif
}
开发者ID:jtorresfabra,项目名称:GLSL-Debugger,代码行数:18,代码来源:intermOut.cpp
示例17: OutputConstantUnion
void OutputConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
int size = node->getType().getObjectSize();
for (int i = 0; i < size; i++)
{
OutputTreeText(out, node, oit->depth);
switch (node->getUnionArrayPointer()[i].getType())
{
case EbtBool:
if (node->getUnionArrayPointer()[i].getBConst())
out.debug << "true";
else
out.debug << "false";
out.debug << " (" << "const bool" << ")";
out.debug << "\n";
break;
case EbtFloat:
{
char buf[300];
sprintf(buf, "%f (%s)", node->getUnionArrayPointer()[i].getFConst(), "const float");
out.debug << buf << "\n";
}
break;
case EbtInt:
{
char buf[300];
sprintf(buf, "%d (%s)", node->getUnionArrayPointer()[i].getIConst(), "const int");
out.debug << buf << "\n";
break;
}
default:
out.info.message(EPrefixInternalError, "Unknown constant", node->getLine());
break;
}
}
}
开发者ID:CRivlaldo,项目名称:hlsl2glslfork,代码行数:44,代码来源:intermOut.cpp
示例18: OutputConstant
void OutputConstant(TIntermConstant* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
int size = node->getCount();
for (int i = 0; i < size; i++)
{
OutputTreeText(out, node, oit->depth);
switch (node->getValue(i).type)
{
case EbtBool:
if (node->toBool(i))
out.debug << "true";
else
out.debug << "false";
out.debug << " (" << "const bool" << ")";
out.debug << "\n";
break;
case EbtFloat:
{
char buf[300];
sprintf(buf, "%f (%s)", node->toFloat(i), "const float");
out.debug << buf << "\n";
}
break;
case EbtInt:
{
char buf[300];
sprintf(buf, "%d (%s)", node->toInt(i), "const int");
out.debug << buf << "\n";
break;
}
default:
out.info.message(EPrefixInternalError, "Unknown constant", node->getLine());
break;
}
}
}
开发者ID:Groovounet,项目名称:hlsl2glslfork,代码行数:44,代码来源:intermOut.cpp
示例19: OutputParameter
void OutputParameter(TIntermParameter* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
TType* t = node->getType();
if (t->getBasicType() != EbtStruct) {
out.debug << "param '" << t->getFieldName() << "' (" <<
t->getCompleteString() << ")\n";
} else {
out.debug << "param '" << t->getFieldName() << "' (" <<
t->getCompleteString() << " '" <<
t->getTypeName() << "')\n";
}
}
开发者ID:jtorresfabra,项目名称:GLSL-Debugger,代码行数:19,代码来源:intermOut.cpp
示例20: OutputBranch
bool OutputBranch(bool /* previsit*/, TIntermBranch* node, TIntermTraverser* it)
{
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputExtensionText(out, node);
OutputTreeText(out, node, oit->depth);
switch (node->getFlowOp()) {
case EOpKill:
out.debug << "Branch: Kill";
break;
case EOpBreak:
out.debug << "Branch: Break";
break;
case EOpContinue:
out.debug << "Branch: Continue";
break;
case EOpReturn:
out.debug << "Branch: Return";
break;
default:
out.debug << "Branch: Unknown Branch";
break;
}
if (node->getExpression()) {
out.debug << " with expression";
OutputDebugText(out, node);
out.debug << "\n";
#if DEBUG_SCOPE == 1
OutputScopeText(oit->infoSink, node, oit->depth);
#endif
++oit->depth;
node->getExpression()->traverse(it);
--oit->depth;
} else
out.debug << "\n";
return false;
}
开发者ID:jtorresfabra,项目名称:GLSL-Debugger,代码行数:43,代码来源:intermOut.cpp
注:本文中的OutputTreeText函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论