zenilib: sh::OutputHLSL 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 | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
sh::OutputHLSL Class Reference

`#include <OutputHLSL.h>`

Inherits TIntermTraverser.

## Public Member Functions

| OutputHLSL (TParseContext &context, const ShBuiltInResources &resources, ShShaderOutput outputType)
| ~OutputHLSL ()
TInfoSinkBase & | getBodyStream ()
const ActiveUniforms & | getUniforms ()
void | output ()
TString | textureString (const TType &type)
TString | typeString (const TType &type)
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 ()

## Static Public Member Functions

static TString | arrayString (const TType &type)
static TString | decorate (const TString &string)
static TString | decorateField (const TString &string, const TType &structure)
static TString | decorateUniform (const TString &string, const TType &type)
static TString | initializer (const TType &type)
static TString | qualifierString (TQualifier qualifier)
Static Public Member Functions inherited from TIntermTraverser
static TString | hash (const TString &name, ShHashFunction64 hashFunction)

## Protected Types

typedef std::set< TString > | Constructors
typedef std::map< TString, TIntermSymbol * > | ReferencedSymbols
typedef std::vector< int > | ScopeBracket
typedef std::list< TString > | StructDeclarations
typedef std::set< TString > | StructNames

## Protected Member Functions

void | addConstructor (const TType &type, const TString &name, const TIntermSequence *parameters)
TString | argumentString (const TIntermSymbol *symbol)
void | declareUniform (const TType &type, const TString &name, int index)
bool | handleExcessiveLoop (TIntermLoop *node)
void | header ()
bool | isSingleStatement (TIntermNode *node)
void | outputLineDirective (int line)
void | outputTriplet (Visit visit, const TString &preString, const TString &inString, const TString &postString)
TString | registerString (TIntermSymbol *operand)
int | samplerRegister (TIntermSymbol *sampler)
TString | scopedStruct (const TString &typeName)
TString | scopeString (unsigned int depthLimit)
TString | structLookup (const TString &typeName)
void | traverseStatements (TIntermNode *node)
int | uniformRegister (TIntermSymbol *uniform)
int | vectorSize (const TType &type) const
bool | visitAggregate (Visit visit, TIntermAggregate *)
bool | visitBinary (Visit visit, TIntermBinary *)
bool | visitBranch (Visit visit, TIntermBranch *)
void | visitConstantUnion (TIntermConstantUnion *)
bool | visitLoop (Visit visit, TIntermLoop *)
bool | visitSelection (Visit visit, TIntermSelection *)
void | visitSymbol (TIntermSymbol *)
bool | visitUnary (Visit visit, TIntermUnary *)
const ConstantUnion * | writeConstantUnion (const TType &type, const ConstantUnion *constUnion)

## Static Protected Member Functions

static GLenum | glVariablePrecision (const TType &type)
static GLenum | glVariableType (const TType &type)

## Protected Attributes

ActiveUniforms | mActiveUniforms
TInfoSinkBase | mBody
Constructors | mConstructors
bool | mContainsLoopDiscontinuity
TParseContext & | mContext
TIntermSymbol * | mExcessiveLoopIndex
TInfoSinkBase | mFooter
TInfoSinkBase | mHeader
bool | mInsideDiscontinuousLoop
bool | mInsideFunction
int | mNumRenderTargets
bool | mOutputLod0Function
const ShShaderOutput | mOutputType
ReferencedSymbols | mReferencedAttributes
ReferencedSymbols | mReferencedUniforms
ReferencedSymbols | mReferencedVaryings
int | mSamplerRegister
ScopeBracket | mScopeBracket
unsigned int | mScopeDepth
StructDeclarations | mStructDeclarations
StructNames | mStructNames
UnfoldShortCircuit * | mUnfoldShortCircuit
int | mUniformRegister
int | mUniqueIndex
bool | mUsesAtan2_1
bool | mUsesAtan2_2
bool | mUsesAtan2_3
bool | mUsesAtan2_4
bool | mUsesDepthRange
bool | mUsesFaceforward1
bool | mUsesFaceforward2
bool | mUsesFaceforward3
bool | mUsesFaceforward4
bool | mUsesFragColor
bool | mUsesFragCoord
bool | mUsesFragData
bool | mUsesFragDepth
bool | mUsesFrontFacing
bool | mUsesMod1
bool | mUsesMod2f
bool | mUsesMod2v
bool | mUsesMod3f
bool | mUsesMod3v
bool | mUsesMod4f
bool | mUsesMod4v
bool | mUsesPointCoord
bool | mUsesPointSize
bool | mUsesTexture2D
bool | mUsesTexture2D_bias
bool | mUsesTexture2DLod
bool | mUsesTexture2DLod0
bool | mUsesTexture2DLod0_bias
bool | mUsesTexture2DProj
bool | mUsesTexture2DProj_bias
bool | mUsesTexture2DProjLod
bool | mUsesTexture2DProjLod0
bool | mUsesTexture2DProjLod0_bias
bool | mUsesTextureCube
bool | mUsesTextureCube_bias
bool | mUsesTextureCubeLod
bool | mUsesTextureCubeLod0
bool | mUsesTextureCubeLod0_bias
bool | mUsesXor
Protected Attributes inherited from TIntermTraverser
int | depth
int | maxDepth

## Additional Inherited Members

Public Attributes inherited from TIntermTraverser
const bool | inVisit
const bool | postVisit
const bool | preVisit
const bool | rightToLeft

## Detailed Description

Definition at line 25 of file OutputHLSL.h.

## Member Typedef Documentation

typedef std::set<TString> sh::OutputHLSL::Constructors

protected

Definition at line 131 of file OutputHLSL.h.

typedef std::map<TString, TIntermSymbol*> sh::OutputHLSL::ReferencedSymbols

protected

Definition at line 83 of file OutputHLSL.h.

typedef std::vector<int> sh::OutputHLSL::ScopeBracket

protected

Definition at line 140 of file OutputHLSL.h.

typedef std::list<TString> sh::OutputHLSL::StructDeclarations

protected

Definition at line 137 of file OutputHLSL.h.

typedef std::set<TString> sh::OutputHLSL::StructNames

protected

Definition at line 134 of file OutputHLSL.h.

## Constructor & Destructor Documentation

sh::OutputHLSL::OutputHLSL | ( | TParseContext & | context,
|  | const ShBuiltInResources & | resources,
|  | ShShaderOutput | outputType
| ) |  |

Definition at line 30 of file OutputHLSL.cpp.

References ShBuiltInResources::EXT_draw_buffers, ShBuiltInResources::MaxDrawBuffers, mContainsLoopDiscontinuity, mContext, mExcessiveLoopIndex, mInsideDiscontinuousLoop, mInsideFunction, mNumRenderTargets, mOutputLod0Function, mOutputType, mSamplerRegister, mScopeDepth, mUnfoldShortCircuit, mUniformRegister, mUniqueIndex, mUsesAtan2_1, mUsesAtan2_2, mUsesAtan2_3, mUsesAtan2_4, mUsesDepthRange, mUsesFaceforward1, mUsesFaceforward2, mUsesFaceforward3, mUsesFaceforward4, mUsesFragColor, mUsesFragCoord, mUsesFragData, mUsesFragDepth, mUsesFrontFacing, mUsesMod1, mUsesMod2f, mUsesMod2v, mUsesMod3f, mUsesMod3v, mUsesMod4f, mUsesMod4v, mUsesPointCoord, mUsesPointSize, mUsesTexture2D, mUsesTexture2D_bias, mUsesTexture2DLod, mUsesTexture2DLod0, mUsesTexture2DLod0_bias, mUsesTexture2DProj, mUsesTexture2DProj_bias, mUsesTexture2DProjLod, mUsesTexture2DProjLod0, mUsesTexture2DProjLod0_bias, mUsesTextureCube, mUsesTextureCube_bias, mUsesTextureCubeLod, mUsesTextureCubeLod0, mUsesTextureCubeLod0_bias, mUsesXor, NULL, SH_FRAGMENT_SHADER, SH_HLSL9_OUTPUT, and TParseContext::shaderType.

sh::OutputHLSL::~OutputHLSL | ( |  | ) |

Definition at line 107 of file OutputHLSL.cpp.

References mUnfoldShortCircuit.

## Member Function Documentation

void sh::OutputHLSL::addConstructor | ( | const TType & | type,
|  | const TString & | name,
|  | const TIntermSequence * | parameters
| ) |  |

protected

Definition at line 2558 of file OutputHLSL.cpp.

References arrayString(), ASSERT, TType::clearArrayness(), decorate(), decorateField(), EbpHigh, EvqTemporary, TStructure::fields(), TType::getNominalSize(), TType::getObjectSize(), TType::getStruct(), i, TType::isMatrix(), TType::isScalar(), TType::isVector(), mConstructors, mStructDeclarations, mStructNames, TField::name(), TType::setPrecision(), TType::setQualifier(), sh::str(), TField::type(), typeString(), and UNREACHABLE.

Referenced by visitAggregate().

TString sh::OutputHLSL::argumentString | ( | const TIntermSymbol * | symbol | ) |

protected

Definition at line 2392 of file OutputHLSL.cpp.

References arrayString(), decorate(), TType::getBasicType(), TIntermTyped::getQualifier(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), IsSampler(), mOutputType, mUniqueIndex, qualifierString(), SH_HLSL11_OUTPUT, sh::str(), textureString(), and typeString().

Referenced by visitAggregate().

TString sh::OutputHLSL::arrayString | ( | const TType & | type | ) |

static

Definition at line 2530 of file OutputHLSL.cpp.

References TType::getArraySize(), TType::isArray(), and sh::str().

Referenced by addConstructor(), argumentString(), header(), typeString(), and visitAggregate().

void sh::OutputHLSL::declareUniform | ( | const TType & | type,
|  | const TString & | name,
|  | int | index
| ) |  |

protected

Definition at line 2942 of file OutputHLSL.cpp.

References TStructure::fields(), TType::getArraySize(), TType::getStruct(), glVariablePrecision(), glVariableType(), i, TType::isArray(), j, mActiveUniforms, sh::str(), and TType::totalRegisterCount().

Referenced by samplerRegister(), and uniformRegister().

TString sh::OutputHLSL::decorate | ( | const TString & | string | ) |

static

Definition at line 2874 of file OutputHLSL.cpp.

Referenced by addConstructor(), argumentString(), decorateField(), decorateUniform(), header(), structLookup(), typeString(), visitAggregate(), and visitSymbol().

TString sh::OutputHLSL::decorateField | ( | const TString & | string,
|  | const TType & | structure
| ) |  |

static

Definition at line 2894 of file OutputHLSL.cpp.

References decorate(), TType::getStruct(), and TStructure::name().

Referenced by addConstructor(), and visitBinary().

TString sh::OutputHLSL::decorateUniform | ( | const TString & | string,
|  | const TType & | type
| ) |  |

static

Definition at line 2884 of file OutputHLSL.cpp.

References decorate(), EbtSamplerExternalOES, and TType::getBasicType().

Referenced by header(), and visitSymbol().

TInfoSinkBase & sh::OutputHLSL::getBodyStream | ( |  | ) |

Definition at line 123 of file OutputHLSL.cpp.

References mBody.

Referenced by sh::UnfoldShortCircuit::visitBinary(), and sh::UnfoldShortCircuit::visitSelection().

const ActiveUniforms & sh::OutputHLSL::getUniforms | ( |  | ) |

Definition at line 128 of file OutputHLSL.cpp.

References mActiveUniforms.

Referenced by TranslatorHLSL::translate().

GLenum sh::OutputHLSL::glVariablePrecision | ( | const TType & | type | ) |

staticprotected

Definition at line 3063 of file OutputHLSL.cpp.

References EbpHigh, EbpLow, EbpMedium, EbpUndefined, EbtFloat, EbtInt, TType::getBasicType(), TType::getPrecision(), GL_HIGH_FLOAT, GL_HIGH_INT, GL_LOW_FLOAT, GL_LOW_INT, GL_MEDIUM_FLOAT, GL_MEDIUM_INT, GL_NONE, and UNREACHABLE.

Referenced by declareUniform().

GLenum sh::OutputHLSL::glVariableType | ( | const TType & | type | ) |

staticprotected

Definition at line 2984 of file OutputHLSL.cpp.

References EbtBool, EbtFloat, EbtInt, EbtSampler2D, EbtSamplerCube, TType::getBasicType(), TType::getNominalSize(), GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4, GL_FLOAT, GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FLOAT_MAT4, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, GL_INT, GL_INT_VEC2, GL_INT_VEC3, GL_INT_VEC4, GL_NONE, GL_SAMPLER_2D, GL_SAMPLER_CUBE, TType::isMatrix(), TType::isScalar(), TType::isVector(), and UNREACHABLE.

Referenced by declareUniform().

bool sh::OutputHLSL::handleExcessiveLoop | ( | TIntermLoop * | node | ) |

protected

Definition at line 2155 of file OutputHLSL.cpp.

References EbtInt, EOpAddAssign, EOpInitialize, EOpLessThan, EOpLessThanEqual, EOpNull, EOpPostDecrement, EOpPostIncrement, EOpPreDecrement, EOpPreIncrement, EOpSubAssign, EvqTemporary, TSourceLoc::first_line, TIntermNode::getAsAggregate(), TIntermNode::getAsBinaryNode(), TIntermNode::getAsConstantUnion(), TIntermNode::getAsSymbolNode(), TIntermNode::getAsUnaryNode(), TIntermTyped::getBasicType(), TIntermLoop::getBody(), TIntermLoop::getCondition(), TIntermLoop::getExpression(), TIntermConstantUnion::getIConst(), TIntermSymbol::getId(), TIntermLoop::getInit(), TIntermBinary::getLeft(), TIntermNode::getLine(), TIntermTyped::getNominalSize(), TIntermOperator::getOp(), TIntermTyped::getQualifier(), TIntermBinary::getRight(), TIntermAggregate::getSequence(), init(), mBody, mExcessiveLoopIndex, min, NULL, outputLineDirective(), TIntermNode::traverse(), TIntermSymbol::traverse(), and UNIMPLEMENTED.

Referenced by visitLoop().

void sh::OutputHLSL::header | ( |  | ) |

protected

Definition at line 141 of file OutputHLSL.cpp.

References arrayString(), decorate(), decorateUniform(), EBhEnable, EBhRequire, TParseContext::extensionBehavior(), TType::getBasicType(), i, initializer(), IsSampler(), mConstructors, mContext, mHeader, mNumRenderTargets, mOutputType, mReferencedAttributes, mReferencedUniforms, mReferencedVaryings, mStructDeclarations, mUsesAtan2_1, mUsesAtan2_2, mUsesAtan2_3, mUsesAtan2_4, mUsesDepthRange, mUsesFaceforward1, mUsesFaceforward2, mUsesFaceforward3, mUsesFaceforward4, mUsesFragColor, mUsesFragCoord, mUsesFragData, mUsesFragDepth, mUsesFrontFacing, mUsesMod1, mUsesMod2f, mUsesMod2v, mUsesMod3f, mUsesMod3v, mUsesMod4f, mUsesMod4v, mUsesPointCoord, mUsesPointSize, mUsesTexture2D, mUsesTexture2D_bias, mUsesTexture2DLod, mUsesTexture2DLod0, mUsesTexture2DLod0_bias, mUsesTexture2DProj, mUsesTexture2DProj_bias, mUsesTexture2DProjLod, mUsesTexture2DProjLod0, mUsesTexture2DProjLod0_bias, mUsesTextureCube, mUsesTextureCube_bias, mUsesTextureCubeLod, mUsesTextureCubeLod0, mUsesTextureCubeLod0_bias, mUsesXor, registerString(), samplerRegister(), SH_FRAGMENT_SHADER, SH_HLSL11_OUTPUT, SH_HLSL9_OUTPUT, TParseContext::shaderType, sh::str(), textureString(), typeString(), and UNREACHABLE.

Referenced by output().

TString sh::OutputHLSL::initializer | ( | const TType & | type | ) |

static

Definition at line 2540 of file OutputHLSL.cpp.

References TType::getObjectSize().

Referenced by header(), and visitAggregate().

bool sh::OutputHLSL::isSingleStatement | ( | TIntermNode * | node | ) |

protected

Definition at line 2126 of file OutputHLSL.cpp.

References EOpSequence, TIntermNode::getAsAggregate(), TIntermOperator::getOp(), and TIntermAggregate::getSequence().

Referenced by traverseStatements().

void sh::OutputHLSL::output | ( |  | ) |

Definition at line 112 of file OutputHLSL.cpp.

References TInfoSinkBase::c_str(), sh::containsLoopDiscontinuity(), header(), TParseContext::infoSink(), mBody, mContainsLoopDiscontinuity, mContext, mHeader, TInfoSink::obj, SH_FRAGMENT_SHADER, TParseContext::shaderType, TIntermNode::traverse(), and TParseContext::treeRoot.

Referenced by TranslatorHLSL::translate().

void sh::OutputHLSL::outputLineDirective | ( | int | line | ) |

protected

Definition at line 2376 of file OutputHLSL.cpp.

References TParseContext::compileOptions, mBody, mContext, SH_LINE_DIRECTIVES, and TParseContext::sourcePath.

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

void sh::OutputHLSL::outputTriplet | ( | Visit | visit,
|  | const TString & | preString,
|  | const TString & | inString,
|  | const TString & | postString
| ) |  |

protected

Definition at line 2358 of file OutputHLSL.cpp.

References InVisit, mBody, PostVisit, and PreVisit.

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

TString sh::OutputHLSL::qualifierString | ( | TQualifier | qualifier | ) |

static

Definition at line 2416 of file OutputHLSL.cpp.

References EvqConstReadOnly, EvqIn, EvqInOut, EvqOut, and UNREACHABLE.

Referenced by argumentString().

TString sh::OutputHLSL::registerString | ( | TIntermSymbol * | operand | ) |

protected

Definition at line 2904 of file OutputHLSL.cpp.

References ASSERT, EvqUniform, TIntermTyped::getBasicType(), TIntermTyped::getQualifier(), IsSampler(), samplerRegister(), sh::str(), and uniformRegister().

Referenced by header().

int sh::OutputHLSL::samplerRegister | ( | TIntermSymbol * | sampler | ) |

protected

Definition at line 2916 of file OutputHLSL.cpp.

References ASSERT, declareUniform(), TType::getBasicType(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), IsSampler(), mSamplerRegister, and TIntermTyped::totalRegisterCount().

Referenced by header(), and registerString().

TString sh::OutputHLSL::scopedStruct | ( | const TString & | typeName | ) |

protected

Definition at line 2844 of file OutputHLSL.cpp.

References mScopeDepth, and scopeString().

Referenced by visitAggregate().

TString sh::OutputHLSL::scopeString | ( | unsigned int | depthLimit | ) |

protected

Definition at line 2832 of file OutputHLSL.cpp.

References i, mScopeBracket, and sh::str().

Referenced by scopedStruct(), and structLookup().

TString sh::OutputHLSL::structLookup | ( | const TString & | typeName | ) |

protected

Definition at line 2854 of file OutputHLSL.cpp.

References decorate(), mScopeDepth, mStructNames, scopeString(), and UNREACHABLE.

Referenced by typeString(), visitAggregate(), and writeConstantUnion().

TString sh::OutputHLSL::textureString | ( | const TType & | type | ) |

Definition at line 2512 of file OutputHLSL.cpp.

References EbtSampler2D, EbtSamplerCube, EbtSamplerExternalOES, TType::getBasicType(), and UNREACHABLE.

Referenced by argumentString(), and header().

void sh::OutputHLSL::traverseStatements | ( | TIntermNode * | node | ) |

protected

Definition at line 2116 of file OutputHLSL.cpp.

References isSingleStatement(), mUnfoldShortCircuit, sh::UnfoldShortCircuit::traverse(), and TIntermNode::traverse().

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

TString sh::OutputHLSL::typeString | ( | const TType & | type | ) |

Definition at line 2430 of file OutputHLSL.cpp.

References arrayString(), decorate(), EbtBool, EbtFloat, EbtInt, EbtSampler2D, EbtSamplerCube, EbtSamplerExternalOES, EbtStruct, EbtVoid, TStructure::fields(), TType::getBasicType(), TType::getNominalSize(), TType::getStruct(), i, TType::isMatrix(), TField::name(), TStructure::name(), structLookup(), TField::type(), and UNREACHABLE.

Referenced by addConstructor(), argumentString(), header(), visitAggregate(), sh::UnfoldShortCircuit::visitSelection(), and writeConstantUnion().

int sh::OutputHLSL::uniformRegister | ( | TIntermSymbol * | uniform | ) |

protected

Definition at line 2929 of file OutputHLSL.cpp.

References ASSERT, declareUniform(), TType::getBasicType(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), IsSampler(), mUniformRegister, and TIntermTyped::totalRegisterCount().

Referenced by registerString().

int sh::OutputHLSL::vectorSize | ( | const TType & | type | ) | const

protected

Definition at line 133 of file OutputHLSL.cpp.

References TType::getArraySize(), TType::getNominalSize(), TType::isArray(), and TType::isMatrix().

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

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 1420 of file OutputHLSL.cpp.

References addConstructor(), argumentString(), arrayString(), ASSERT, decorate(), 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, EvqGlobal, EvqInvariantVaryingOut, EvqTemporary, EvqVaryingOut, TSourceLoc::first_line, TIntermNode::getAsSymbolNode(), TIntermSymbol::getAsSymbolNode(), TIntermNode::getLine(), TIntermAggregate::getName(), TIntermOperator::getOp(), TIntermTyped::getQualifier(), TIntermAggregate::getSequence(), TType::getStruct(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), i, initializer(), InVisit, IsSampler(), TIntermAggregate::isUserDefined(), TSourceLoc::last_line, mBody, mContainsLoopDiscontinuity, mInsideDiscontinuousLoop, mInsideFunction, mOutputLod0Function, mOutputType, mReferencedVaryings, mScopeBracket, mScopeDepth, mUsesAtan2_1, mUsesAtan2_2, mUsesAtan2_3, mUsesAtan2_4, mUsesFaceforward1, mUsesFaceforward2, mUsesFaceforward3, mUsesFaceforward4, mUsesMod1, mUsesMod2f, mUsesMod2v, mUsesMod3f, mUsesMod3v, mUsesMod4f, mUsesMod4v, mUsesTexture2D, mUsesTexture2D_bias, mUsesTexture2DLod, mUsesTexture2DLod0, mUsesTexture2DLod0_bias, mUsesTexture2DProj, mUsesTexture2DProj_bias, mUsesTexture2DProjLod, mUsesTexture2DProjLod0, mUsesTexture2DProjLod0_bias, mUsesTextureCube, mUsesTextureCube_bias, mUsesTextureCubeLod, mUsesTextureCubeLod0, mUsesTextureCubeLod0_bias, TStructure::name(), NULL, outputLineDirective(), outputTriplet(), PreVisit, scopedStruct(), SH_HLSL11_OUTPUT, structLookup(), TIntermSymbol::traverse(), TIntermAggregate::traverse(), traverseStatements(), typeString(), TFunction::unmangleName(), and UNREACHABLE.

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

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 1102 of file OutputHLSL.cpp.

References ASSERT, decorateField(), EbtStruct, EOpAdd, EOpAddAssign, EOpAssign, EOpDiv, EOpDivAssign, EOpEqual, EOpGreaterThan, EOpGreaterThanEqual, EOpIndexDirect, EOpIndexDirectStruct, EOpIndexIndirect, EOpInitialize, EOpLessThan, EOpLessThanEqual, EOpLogicalAnd, EOpLogicalOr, EOpLogicalXor, EOpMatrixTimesMatrix, EOpMatrixTimesMatrixAssign, EOpMatrixTimesScalar, EOpMatrixTimesScalarAssign, EOpMatrixTimesVector, EOpMul, EOpMulAssign, EOpNotEqual, EOpSub, EOpSubAssign, EOpVectorSwizzle, EOpVectorTimesMatrix, EOpVectorTimesMatrixAssign, EOpVectorTimesScalar, EOpVectorTimesScalarAssign, TStructure::fields(), TIntermNode::getAsAggregate(), TIntermNode::getAsConstantUnion(), TIntermConstantUnion::getAsConstantUnion(), TIntermNode::getAsSymbolNode(), TIntermTyped::getBasicType(), TIntermConstantUnion::getIConst(), TIntermBinary::getLeft(), sh::UnfoldShortCircuit::getNextTemporaryIndex(), TIntermOperator::getOp(), TIntermBinary::getRight(), TIntermAggregate::getSequence(), TType::getStruct(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), i, InVisit, TIntermTyped::isMatrix(), TIntermTyped::isScalar(), TIntermTyped::isVector(), mBody, mUnfoldShortCircuit, mUniqueIndex, mUsesXor, TField::name(), outputTriplet(), PreVisit, sh::str(), TIntermNode::traverse(), TIntermSymbol::traverse(), and UNREACHABLE.

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

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 2067 of file OutputHLSL.cpp.

References EOpBreak, EOpContinue, EOpKill, EOpReturn, TIntermBranch::getExpression(), TIntermBranch::getFlowOp(), mBody, mExcessiveLoopIndex, outputTriplet(), PostVisit, PreVisit, TIntermSymbol::traverse(), and UNREACHABLE.

void sh::OutputHLSL::visitConstantUnion | ( | TIntermConstantUnion * | node | ) |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 1982 of file OutputHLSL.cpp.

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

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

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 1987 of file OutputHLSL.cpp.

References sh::containsLoopDiscontinuity(), ELoopDoWhile, TSourceLoc::first_line, TIntermLoop::getBody(), TIntermLoop::getCondition(), TIntermLoop::getExpression(), TIntermLoop::getInit(), TIntermNode::getLine(), TIntermLoop::getType(), handleExcessiveLoop(), mBody, mContainsLoopDiscontinuity, mInsideDiscontinuousLoop, mOutputType, outputLineDirective(), SH_HLSL9_OUTPUT, TIntermNode::traverse(), and traverseStatements().

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

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 1935 of file OutputHLSL.cpp.

References TSourceLoc::first_line, TIntermSelection::getCondition(), TIntermSelection::getFalseBlock(), TIntermNode::getLine(), sh::UnfoldShortCircuit::getNextTemporaryIndex(), TIntermSelection::getTrueBlock(), mBody, mUnfoldShortCircuit, outputLineDirective(), sh::UnfoldShortCircuit::traverse(), TIntermNode::traverse(), traverseStatements(), and TIntermSelection::usesTernaryOperator().

void sh::OutputHLSL::visitSymbol | ( | TIntermSymbol * | node | ) |

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 1030 of file OutputHLSL.cpp.

References decorate(), decorateUniform(), EvqAttribute, EvqInvariantVaryingIn, EvqInvariantVaryingOut, EvqUniform, EvqVaryingIn, EvqVaryingOut, TIntermTyped::getQualifier(), TIntermSymbol::getSymbol(), TIntermTyped::getType(), mBody, mReferencedAttributes, mReferencedUniforms, mReferencedVaryings, mUsesDepthRange, mUsesFragColor, mUsesFragCoord, mUsesFragData, mUsesFragDepth, mUsesFrontFacing, mUsesPointCoord, and mUsesPointSize.

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

protectedvirtual

Reimplemented from TIntermTraverser.

Definition at line 1317 of file OutputHLSL.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, TType::getNominalSize(), TIntermOperator::getOp(), TIntermUnary::getOperand(), TIntermTyped::getType(), mInsideDiscontinuousLoop, mOutputLod0Function, outputTriplet(), and UNREACHABLE.

const ConstantUnion * sh::OutputHLSL::writeConstantUnion | ( | const TType & | type,
|  | const ConstantUnion * | constUnion
| ) |  |

protected

Definition at line 2773 of file OutputHLSL.cpp.

References EbtBool, EbtFloat, EbtInt, EbtStruct, TStructure::fields(), TType::getBasicType(), ConstantUnion::getBConst(), ConstantUnion::getFConst(), ConstantUnion::getIConst(), TType::getObjectSize(), TType::getStruct(), ConstantUnion::getType(), i, max, mBody, min, TStructure::name(), structLookup(), typeString(), and UNREACHABLE.

Referenced by visitConstantUnion().

## Member Data Documentation

ActiveUniforms sh::OutputHLSL::mActiveUniforms

protected

Definition at line 162 of file OutputHLSL.h.

Referenced by declareUniform(), and getUniforms().

TInfoSinkBase sh::OutputHLSL::mBody

protected

Definition at line 80 of file OutputHLSL.h.

Referenced by getBodyStream(), handleExcessiveLoop(), output(), outputLineDirective(), outputTriplet(), visitAggregate(), visitBinary(), visitBranch(), visitLoop(), visitSelection(), visitSymbol(), and writeConstantUnion().

Constructors sh::OutputHLSL::mConstructors

protected

Definition at line 132 of file OutputHLSL.h.

Referenced by addConstructor(), and header().

bool sh::OutputHLSL::mContainsLoopDiscontinuity

protected

Definition at line 146 of file OutputHLSL.h.

Referenced by output(), OutputHLSL(), visitAggregate(), and visitLoop().

TParseContext& sh::OutputHLSL::mContext

protected

Definition at line 73 of file OutputHLSL.h.

Referenced by header(), output(), OutputHLSL(), and outputLineDirective().

TIntermSymbol* sh::OutputHLSL::mExcessiveLoopIndex

protected

Definition at line 150 of file OutputHLSL.h.

Referenced by handleExcessiveLoop(), OutputHLSL(), and visitBranch().

TInfoSinkBase sh::OutputHLSL::mFooter

protected

Definition at line 81 of file OutputHLSL.h.

TInfoSinkBase sh::OutputHLSL::mHeader

protected

Definition at line 79 of file OutputHLSL.h.

Referenced by header(), and output().

bool sh::OutputHLSL::mInsideDiscontinuousLoop

protected

Definition at line 148 of file OutputHLSL.h.

Referenced by OutputHLSL(), visitAggregate(), visitLoop(), and visitUnary().

bool sh::OutputHLSL::mInsideFunction

protected

Definition at line 76 of file OutputHLSL.h.

Referenced by OutputHLSL(), and visitAggregate().

int sh::OutputHLSL::mNumRenderTargets

protected

Definition at line 129 of file OutputHLSL.h.

Referenced by header(), and OutputHLSL().

bool sh::OutputHLSL::mOutputLod0Function

protected

Definition at line 147 of file OutputHLSL.h.

Referenced by OutputHLSL(), visitAggregate(), and visitUnary().

const ShShaderOutput sh::OutputHLSL::mOutputType

protected

Definition at line 74 of file OutputHLSL.h.

Referenced by argumentString(), header(), OutputHLSL(), visitAggregate(), and visitLoop().

ReferencedSymbols sh::OutputHLSL::mReferencedAttributes

protected

Definition at line 85 of file OutputHLSL.h.

Referenced by header(), and visitSymbol().

ReferencedSymbols sh::OutputHLSL::mReferencedUniforms

protected

Definition at line 84 of file OutputHLSL.h.

Referenced by header(), and visitSymbol().

ReferencedSymbols sh::OutputHLSL::mReferencedVaryings

protected

Definition at line 86 of file OutputHLSL.h.

Referenced by header(), visitAggregate(), and visitSymbol().

int sh::OutputHLSL::mSamplerRegister

protected

Definition at line 153 of file OutputHLSL.h.

Referenced by OutputHLSL(), and samplerRegister().

ScopeBracket sh::OutputHLSL::mScopeBracket

protected

Definition at line 141 of file OutputHLSL.h.

Referenced by scopeString(), and visitAggregate().

unsigned int sh::OutputHLSL::mScopeDepth

protected

Definition at line 142 of file OutputHLSL.h.

Referenced by OutputHLSL(), scopedStruct(), structLookup(), and visitAggregate().

StructDeclarations sh::OutputHLSL::mStructDeclarations

protected

Definition at line 138 of file OutputHLSL.h.

Referenced by addConstructor(), and header().

StructNames sh::OutputHLSL::mStructNames

protected

Definition at line 135 of file OutputHLSL.h.

Referenced by addConstructor(), and structLookup().

UnfoldShortCircuit* sh::OutputHLSL::mUnfoldShortCircuit

protected

Definition at line 75 of file OutputHLSL.h.

Referenced by OutputHLSL(), traverseStatements(), visitBinary(), visitSelection(), and ~OutputHLSL().

int sh::OutputHLSL::mUniformRegister

protected

Definition at line 152 of file OutputHLSL.h.

Referenced by OutputHLSL(), and uniformRegister().

int sh::OutputHLSL::mUniqueIndex

protected

Definition at line 144 of file OutputHLSL.h.

Referenced by argumentString(), OutputHLSL(), and visitBinary().

bool sh::OutputHLSL::mUsesAtan2_1

protected

Definition at line 124 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesAtan2_2

protected

Definition at line 125 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesAtan2_3

protected

Definition at line 126 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesAtan2_4

protected

Definition at line 127 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesDepthRange

protected

Definition at line 106 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesFaceforward1

protected

Definition at line 120 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesFaceforward2

protected

Definition at line 121 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesFaceforward3

protected

Definition at line 122 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesFaceforward4

protected

Definition at line 123 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesFragColor

protected

Definition at line 104 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesFragCoord

protected

Definition at line 107 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesFragData

protected

Definition at line 105 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesFragDepth

protected

Definition at line 111 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesFrontFacing

protected

Definition at line 109 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesMod1

protected

Definition at line 113 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesMod2f

protected

Definition at line 115 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesMod2v

protected

Definition at line 114 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesMod3f

protected

Definition at line 117 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesMod3v

protected

Definition at line 116 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesMod4f

protected

Definition at line 119 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesMod4v

protected

Definition at line 118 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesPointCoord

protected

Definition at line 108 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesPointSize

protected

Definition at line 110 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitSymbol().

bool sh::OutputHLSL::mUsesTexture2D

protected

Definition at line 89 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2D_bias

protected

Definition at line 90 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DLod

protected

Definition at line 91 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DLod0

protected

Definition at line 98 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DLod0_bias

protected

Definition at line 99 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DProj

protected

Definition at line 92 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DProj_bias

protected

Definition at line 93 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DProjLod

protected

Definition at line 94 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DProjLod0

protected

Definition at line 100 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTexture2DProjLod0_bias

protected

Definition at line 101 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTextureCube

protected

Definition at line 95 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTextureCube_bias

protected

Definition at line 96 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTextureCubeLod

protected

Definition at line 97 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTextureCubeLod0

protected

Definition at line 102 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesTextureCubeLod0_bias

protected

Definition at line 103 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitAggregate().

bool sh::OutputHLSL::mUsesXor

protected

Definition at line 112 of file OutputHLSL.h.

Referenced by header(), OutputHLSL(), and visitBinary().

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

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