zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sh::OutputHLSL Class Reference

#include <OutputHLSL.h>

Inherits TIntermTraverser.

Public Member Functions

 OutputHLSL (TParseContext &context, const ShBuiltInResources &resources, ShShaderOutput outputType)
 
 ~OutputHLSL ()
 
TInfoSinkBasegetBodyStream ()
 
const ActiveUniformsgetUniforms ()
 
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< TStringConstructors
 
typedef std::map< TString,
TIntermSymbol * > 
ReferencedSymbols
 
typedef std::vector< intScopeBracket
 
typedef std::list< TStringStructDeclarations
 
typedef std::set< TStringStructNames
 

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 ConstantUnionwriteConstantUnion (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
 
TParseContextmContext
 
TIntermSymbolmExcessiveLoopIndex
 
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
 
UnfoldShortCircuitmUnfoldShortCircuit
 
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.

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 ( )

Definition at line 107 of file OutputHLSL.cpp.

References mUnfoldShortCircuit.

Member Function Documentation

TString sh::OutputHLSL::arrayString ( const TType type)
static
void sh::OutputHLSL::declareUniform ( const TType type,
const TString name,
int  index 
)
protected
TString sh::OutputHLSL::decorate ( const TString string)
static
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
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
void sh::OutputHLSL::outputLineDirective ( int  line)
protected
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
int sh::OutputHLSL::samplerRegister ( TIntermSymbol sampler)
protected
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
TString sh::OutputHLSL::textureString ( const TType type)
void sh::OutputHLSL::traverseStatements ( TIntermNode node)
protected
int sh::OutputHLSL::uniformRegister ( TIntermSymbol uniform)
protected
int sh::OutputHLSL::vectorSize ( const TType type) const
protected
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::visitBranch ( Visit  visit,
TIntermBranch node 
)
protectedvirtual
void sh::OutputHLSL::visitConstantUnion ( TIntermConstantUnion node)
protectedvirtual

Member Data Documentation

ActiveUniforms sh::OutputHLSL::mActiveUniforms
protected

Definition at line 162 of file OutputHLSL.h.

Referenced by declareUniform(), and getUniforms().

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: