zenilib: TOutputGLSLBase Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
TOutputGLSLBase Class Referenceabstract

`#include <OutputGLSLBase.h>`

Inherits TIntermTraverser.

Inherited by TOutputESSL, and TOutputGLSL.

## Public Member Functions

| TOutputGLSLBase (TInfoSinkBase &objSink, ShArrayIndexClampingStrategy clampingStrategy, ShHashFunction64 hashFunction, NameMap &nameMap, TSymbolTable &symbolTable)
Public Member Functions inherited from TIntermTraverser
| TIntermTraverser (bool preVisit=true, bool inVisit=false, bool postVisit=false, bool rightToLeft=false)
virtual | ~TIntermTraverser ()
void | decrementDepth ()
int | getMaxDepth () const
void | incrementDepth ()
| POOL_ALLOCATOR_NEW_DELETE ()

## Protected Member Functions

TString | getTypeName (const TType &type)
TString | hashFunctionName (const TString &mangled_name)
TString | hashName (const TString &name)
TString | hashVariableName (const TString &name)
TInfoSinkBase & | objSink ()
virtual bool | visitAggregate (Visit visit, TIntermAggregate *node)
virtual bool | visitBinary (Visit visit, TIntermBinary *node)
virtual bool | visitBranch (Visit visit, TIntermBranch *node)
void | visitCodeBlock (TIntermNode *node)
virtual void | visitConstantUnion (TIntermConstantUnion *node)
virtual bool | visitLoop (Visit visit, TIntermLoop *node)
virtual bool | visitSelection (Visit visit, TIntermSelection *node)
virtual void | visitSymbol (TIntermSymbol *node)
virtual bool | visitUnary (Visit visit, TIntermUnary *node)
const ConstantUnion * | writeConstantUnion (const TType &type, const ConstantUnion *pConstUnion)
void | writeFunctionParameters (const TIntermSequence &args)
void | writeTriplet (Visit visit, const char *preStr, const char *inStr, const char *postStr)
virtual bool | writeVariablePrecision (TPrecision precision)=0
void | writeVariableType (const TType &type)

## Additional Inherited Members

Static Public Member Functions inherited from TIntermTraverser
static TString | hash (const TString &name, ShHashFunction64 hashFunction)
Public Attributes inherited from TIntermTraverser
const bool | inVisit
const bool | postVisit
const bool | preVisit
const bool | rightToLeft
Protected Attributes inherited from TIntermTraverser
int | depth
int | maxDepth

## Detailed Description

Definition at line 16 of file OutputGLSLBase.h.

## Constructor & Destructor Documentation

TOutputGLSLBase::TOutputGLSLBase | ( | TInfoSinkBase & | objSink,
|  | ShArrayIndexClampingStrategy | clampingStrategy,
|  | ShHashFunction64 | hashFunction,
|  | NameMap & | nameMap,
|  | TSymbolTable & | symbolTable
| ) |  |

Definition at line 42 of file OutputGLSLBase.cpp.

## Member Function Documentation

TString TOutputGLSLBase::getTypeName | ( | const TType & | type | ) |

protected

Definition at line 737 of file OutputGLSLBase.cpp.

References TInfoSinkBase::c_str(), EbtBool, EbtFloat, EbtInt, EbtStruct, TType::getBasicString(), TType::getBasicType(), TType::getNominalSize(), TType::getStruct(), hashName(), TType::isMatrix(), TType::isVector(), TStructure::name(), and UNREACHABLE.

Referenced by writeConstantUnion(), and writeVariableType().

TString TOutputGLSLBase::hashFunctionName | ( | const TString & | mangled_name | ) |

protected

Definition at line 785 of file OutputGLSLBase.cpp.

References TSymbolTable::findBuiltIn(), hashName(), NULL, and TFunction::unmangleName().

Referenced by visitAggregate().

TString TOutputGLSLBase::hashName | ( | const TString & | name | ) |

protected

Definition at line 766 of file OutputGLSLBase.cpp.

References TIntermTraverser::hash(), and NULL.

Referenced by getTypeName(), hashFunctionName(), hashVariableName(), visitAggregate(), visitBinary(), writeConstantUnion(), and writeFunctionParameters().

TString TOutputGLSLBase::hashVariableName | ( | const TString & | name | ) |

protected

Definition at line 778 of file OutputGLSLBase.cpp.

References TSymbolTable::findBuiltIn(), hashName(), and NULL.

Referenced by visitSymbol().

TInfoSinkBase& TOutputGLSLBase::objSink | ( |  | ) |

inlineprotected

Definition at line 26 of file OutputGLSLBase.h.

Referenced by visitAggregate(), visitBinary(), visitCodeBlock(), visitLoop(), visitSelection(), TOutputGLSL::visitSymbol(), visitSymbol(), writeConstantUnion(), writeFunctionParameters(), writeTriplet(), TOutputESSL::writeVariablePrecision(), and writeVariableType().

bool TOutputGLSLBase::visitAggregate | ( | Visit | visit,
|  | TIntermAggregate * | node
| ) |  |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 451 of file OutputGLSLBase.cpp.

References ASSERT, TIntermTraverser::decrementDepth(), EbtStruct, EOpAtan, EOpClamp, EOpComma, EOpConstructBool, EOpConstructBVec2, EOpConstructBVec3, EOpConstructBVec4, EOpConstructFloat, EOpConstructInt, EOpConstructIVec2, EOpConstructIVec3, EOpConstructIVec4, EOpConstructMat2, EOpConstructMat3, EOpConstructMat4, EOpConstructStruct, EOpConstructVec2, EOpConstructVec3, EOpConstructVec4, EOpCross, EOpDeclaration, EOpDistance, EOpDot, EOpFaceForward, EOpFunction, EOpFunctionCall, EOpGreaterThan, EOpGreaterThanEqual, EOpLessThan, EOpLessThanEqual, EOpMax, EOpMin, EOpMix, EOpMod, EOpMul, EOpParameters, EOpPow, EOpPrototype, EOpReflect, EOpRefract, EOpSequence, EOpSmoothStep, EOpStep, EOpVectorEqual, EOpVectorNotEqual, TIntermAggregate::getAsAggregate(), TType::getBasicType(), BuiltInFunctionEmulator::GetEmulatedFunctionName(), TIntermAggregate::getName(), TIntermOperator::getOp(), TIntermAggregate::getSequence(), TType::getStruct(), TIntermTyped::getType(), TIntermAggregate::getUseEmulatedFunction(), hashFunctionName(), hashName(), TIntermTraverser::incrementDepth(), InVisit, TStructure::name(), NULL, objSink(), PreVisit, TIntermNode::traverse(), TIntermAggregate::traverse(), UNREACHABLE, visitCodeBlock(), writeFunctionParameters(), writeTriplet(), and writeVariableType().

bool TOutputGLSLBase::visitBinary | ( | Visit | visit,
|  | TIntermBinary * | node
| ) |  |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 176 of file OutputGLSLBase.cpp.

References ASSERT, EbtInt, EOpAdd, EOpAddAssign, EOpAssign, EOpDiv, EOpDivAssign, EOpEqual, EOpGreaterThan, EOpGreaterThanEqual, EOpIndexDirect, EOpIndexDirectStruct, EOpIndexIndirect, EOpInitialize, EOpLessThan, EOpLessThanEqual, EOpLogicalAnd, EOpLogicalOr, EOpLogicalXor, EOpMatrixTimesMatrix, EOpMatrixTimesMatrixAssign, EOpMatrixTimesScalar, EOpMatrixTimesScalarAssign, EOpMatrixTimesVector, EOpMod, EOpMul, EOpMulAssign, EOpNotEqual, EOpSub, EOpSubAssign, EOpVectorSwizzle, EOpVectorTimesMatrix, EOpVectorTimesMatrixAssign, EOpVectorTimesScalar, EOpVectorTimesScalarAssign, TStructure::fields(), TSymbolTable::findBuiltIn(), TIntermBinary::getAddIndexClamp(), TType::getArraySize(), TIntermNode::getAsAggregate(), TIntermNode::getAsConstantUnion(), TIntermConstantUnion::getAsConstantUnion(), TIntermTyped::getBasicType(), TIntermConstantUnion::getIConst(), TIntermBinary::getLeft(), TType::getNominalSize(), TIntermTyped::getNominalSize(), TIntermOperator::getOp(), TIntermBinary::getRight(), TIntermAggregate::getSequence(), TType::getStruct(), TIntermTyped::getType(), TIntermConstantUnion::getUnionArrayPointer(), hashName(), InVisit, TIntermTyped::isArray(), TField::name(), TStructure::name(), NULL, objSink(), PostVisit, SH_CLAMP_WITH_CLAMP_INTRINSIC, UNIMPLEMENTED, UNREACHABLE, and writeTriplet().

bool TOutputGLSLBase::visitBranch | ( | Visit | visit,
|  | TIntermBranch * | node
| ) |  |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 707 of file OutputGLSLBase.cpp.

References EOpBreak, EOpContinue, EOpKill, EOpReturn, TIntermBranch::getFlowOp(), NULL, UNREACHABLE, and writeTriplet().

void TOutputGLSLBase::visitCodeBlock | ( | TIntermNode * | node | ) |

protected

Definition at line 721 of file OutputGLSLBase.cpp.

References NULL, objSink(), and TIntermNode::traverse().

Referenced by visitAggregate(), visitLoop(), and visitSelection().

void TOutputGLSLBase::visitConstantUnion | ( | TIntermConstantUnion * | node | ) |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 171 of file OutputGLSLBase.cpp.

References TIntermTyped::getType(), TIntermConstantUnion::getUnionArrayPointer(), and writeConstantUnion().

bool TOutputGLSLBase::visitLoop | ( | Visit | visit,
|  | TIntermLoop * | node
| ) |  |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 637 of file OutputGLSLBase.cpp.

References ASSERT, TIntermTraverser::decrementDepth(), ELoopDoWhile, ELoopFor, ELoopWhile, ForLoopUnroll::FillLoopIndexInfo(), TIntermLoop::getBody(), TIntermLoop::getCondition(), TIntermLoop::getExpression(), TIntermLoop::getInit(), TIntermLoop::getType(), TIntermLoop::getUnrollFlag(), TIntermTraverser::incrementDepth(), NULL, objSink(), ForLoopUnroll::Pop(), ForLoopUnroll::Push(), ForLoopUnroll::SatisfiesLoopCondition(), ForLoopUnroll::Step(), TIntermNode::traverse(), and visitCodeBlock().

bool TOutputGLSLBase::visitSelection | ( | Visit | visit,
|  | TIntermSelection * | node
| ) |  |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 414 of file OutputGLSLBase.cpp.

References TIntermTraverser::decrementDepth(), TIntermSelection::getCondition(), TIntermSelection::getFalseBlock(), TIntermSelection::getTrueBlock(), TIntermTraverser::incrementDepth(), objSink(), TIntermNode::traverse(), TIntermSelection::usesTernaryOperator(), and visitCodeBlock().

void TOutputGLSLBase::visitSymbol | ( | TIntermSymbol * | node | ) |

protectedvirtual

Reimplemented from TIntermTraverser.

Reimplemented in TOutputGLSL.

Definition at line 159 of file OutputGLSLBase.cpp.

References arrayBrackets(), ForLoopUnroll::GetLoopIndexValue(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), hashVariableName(), TType::isArray(), ForLoopUnroll::NeedsToReplaceSymbolWithValue(), and objSink().

Referenced by TOutputGLSL::visitSymbol().

bool TOutputGLSLBase::visitUnary | ( | Visit | visit,
|  | TIntermUnary * | node
| ) |  |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 322 of file OutputGLSLBase.cpp.

References EOpAbs, EOpAcos, EOpAll, EOpAny, EOpAsin, EOpAtan, EOpCeil, EOpConvBoolToFloat, EOpConvBoolToInt, EOpConvFloatToBool, EOpConvFloatToInt, EOpConvIntToBool, EOpConvIntToFloat, EOpCos, EOpDegrees, EOpDFdx, EOpDFdy, EOpExp, EOpExp2, EOpFloor, EOpFract, EOpFwidth, EOpInverseSqrt, EOpLength, EOpLog, EOpLog2, EOpLogicalNot, EOpNegative, EOpNormalize, EOpPostDecrement, EOpPostIncrement, EOpPreDecrement, EOpPreIncrement, EOpRadians, EOpSign, EOpSin, EOpSqrt, EOpTan, EOpVectorLogicalNot, BuiltInFunctionEmulator::GetEmulatedFunctionName(), TType::getNominalSize(), TIntermOperator::getOp(), TIntermUnary::getOperand(), TIntermTyped::getType(), TIntermUnary::getUseEmulatedFunction(), NULL, PreVisit, UNREACHABLE, and writeTriplet().

const ConstantUnion * TOutputGLSLBase::writeConstantUnion | ( | const TType & | type,
|  | const ConstantUnion * | pConstUnion
| ) |  |

protected

Definition at line 118 of file OutputGLSLBase.cpp.

References ASSERT, EbtBool, EbtFloat, EbtInt, EbtStruct, TStructure::fields(), TType::getBasicType(), ConstantUnion::getBConst(), ConstantUnion::getFConst(), ConstantUnion::getIConst(), TType::getObjectSize(), TType::getStruct(), ConstantUnion::getType(), getTypeName(), hashName(), i, max, min, TStructure::name(), NULL, objSink(), and UNREACHABLE.

Referenced by visitConstantUnion().

void TOutputGLSLBase::writeFunctionParameters | ( | const TIntermSequence & | args | ) |

protected

Definition at line 94 of file OutputGLSLBase.cpp.

References arrayBrackets(), ASSERT, TIntermSymbol::getAsSymbolNode(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), hashName(), TType::isArray(), NULL, objSink(), and writeVariableType().

Referenced by visitAggregate().

void TOutputGLSLBase::writeTriplet | ( | Visit | visit,
|  | const char * | preStr,
|  | const char * | inStr,
|  | const char * | postStr
| ) |  |

protected

Definition at line 57 of file OutputGLSLBase.cpp.

References InVisit, objSink(), PostVisit, and PreVisit.

Referenced by visitAggregate(), visitBinary(), visitBranch(), and visitUnary().

virtual bool TOutputGLSLBase::writeVariablePrecision | ( | TPrecision | precision | ) |

protectedpure virtual

Implemented in TOutputESSL, and TOutputGLSL.

Referenced by writeVariableType().

void TOutputGLSLBase::writeVariableType | ( | const TType & | type | ) |

protected

Definition at line 74 of file OutputGLSLBase.cpp.

References EbtStruct, EvqGlobal, EvqTemporary, TType::getBasicType(), TType::getPrecision(), TType::getQualifier(), TType::getQualifierString(), TType::getStruct(), getTypeName(), objSink(), and writeVariablePrecision().

Referenced by visitAggregate(), and writeFunctionParameters().

The documentation for this class was generated from the following files:

- zenilib/jni/external/angle/src/compiler/OutputGLSLBase.h
- zenilib/jni/external/angle/src/compiler/OutputGLSLBase.cpp