zenilib: TCompiler 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
TCompiler Class Referenceabstract

`#include <ShHandle.h>`

Inherits TShHandleBase.

Inherited by TranslatorESSL, TranslatorGLSL, and TranslatorHLSL.

## Public Member Functions

| TCompiler (ShShaderType type, ShShaderSpec spec)
virtual | ~TCompiler ()
bool | compile (const char *const shaderStrings[], size_t numStrings, int compileOptions)
virtual TCompiler * | getAsCompiler ()
const TVariableInfoList & | getAttribs () const
ShHashFunction64 | getHashFunction () const
TInfoSink & | getInfoSink ()
int | getMappedNameMaxLength () const
NameMap & | getNameMap ()
TSymbolTable & | getSymbolTable ()
const TVariableInfoList & | getUniforms () const
bool | Init (const ShBuiltInResources &resources)
Public Member Functions inherited from TShHandleBase
| TShHandleBase ()
virtual | ~TShHandleBase ()
virtual TranslatorHLSL * | getAsTranslatorHLSL ()

## Protected Member Functions

void | clearResults ()
void | collectAttribsUniforms (TIntermNode *root)
bool | detectCallDepth (TIntermNode *root, TInfoSink &infoSink, bool limitCallStackDepth)
bool | enforceFragmentShaderTimingRestrictions (const TDependencyGraph &graph)
bool | enforcePackingRestrictions ()
bool | enforceTimingRestrictions (TIntermNode *root, bool outputGraph)
bool | enforceVertexShaderTimingRestrictions (TIntermNode *root)
const ArrayBoundsClamper & | getArrayBoundsClamper () const
ShArrayIndexClampingStrategy | getArrayIndexClampingStrategy () const
const BuiltInFunctionEmulator & | getBuiltInFunctionEmulator () const
const TExtensionBehavior & | getExtensionBehavior () const
const ShBuiltInResources & | getResources () const
ShShaderSpec | getShaderSpec () const
ShShaderType | getShaderType () const
bool | InitBuiltInSymbolTable (const ShBuiltInResources &resources)
bool | limitExpressionComplexity (TIntermNode *root)
void | mapLongVariableNames (TIntermNode *root)
void | rewriteCSSShader (TIntermNode *root)
virtual void | translate (TIntermNode *root)=0
bool | validateLimitations (TIntermNode *root)

## Additional Inherited Members

Protected Attributes inherited from TShHandleBase
TPoolAllocator | allocator

## Detailed Description

Definition at line 58 of file ShHandle.h.

## Constructor & Destructor Documentation

TCompiler::TCompiler | ( | ShShaderType | type,
|  | ShShaderSpec | spec
| ) |  |

Definition at line 58 of file Compiler.cpp.

References LongNameMap::GetInstance().

TCompiler::~TCompiler | ( |  | ) |

virtual

Definition at line 71 of file Compiler.cpp.

References ASSERT, and LongNameMap::Release().

## Member Function Documentation

void TCompiler::clearResults | ( |  | ) |

protected

Definition at line 247 of file Compiler.cpp.

References BuiltInFunctionEmulator::Cleanup(), ArrayBoundsClamper::Cleanup(), TInfoSink::debug, TInfoSinkBase::erase(), TInfoSink::info, and TInfoSink::obj.

Referenced by compile().

void TCompiler::collectAttribsUniforms | ( | TIntermNode * | root | ) |

protected

Definition at line 361 of file Compiler.cpp.

References TIntermNode::traverse().

Referenced by compile().

bool TCompiler::compile | ( | const char *const | shaderStrings[],
|  | size_t | numStrings,
|  | int | compileOptions
| ) |  |

Definition at line 100 of file Compiler.cpp.

References TSymbolTable::atBuiltInLevel(), TSymbolTable::atGlobalLevel(), clearResults(), collectAttribsUniforms(), detectCallDepth(), enforcePackingRestrictions(), enforceTimingRestrictions(), EPrefixError, EPrefixInternalError, TParseContext::fragmentPrecisionHigh, TInfoSink::info, isWebGLBasedSpec(), limitExpressionComplexity(), mapLongVariableNames(), BuiltInFunctionEmulator::MarkBuiltInFunctionsForEmulation(), ForLoopUnroll::MarkForLoopsWithIntegerIndicesForUnrolling(), ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(), NULL, TIntermediate::outputTree(), PaParseStrings(), TSymbolTable::pop(), TIntermediate::postProcess(), TInfoSinkBase::prefix(), TSymbolTable::push(), TIntermediate::remove(), rewriteCSSShader(), SetGlobalParseContext(), SH_ATTRIBUTES_UNIFORMS, SH_CLAMP_INDIRECT_ARRAY_BOUNDS, SH_CSS_SHADERS_SPEC, SH_DEPENDENCY_GRAPH, SH_EMULATE_BUILT_IN_FUNCTIONS, SH_ENFORCE_PACKING_RESTRICTIONS, SH_INTERMEDIATE_TREE, SH_LIMIT_CALL_STACK_DEPTH, SH_LIMIT_EXPRESSION_COMPLEXITY, SH_MAP_LONG_VARIABLE_NAMES, SH_OBJECT_CODE, SH_SOURCE_PATH, SH_TIMING_RESTRICTIONS, SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX, SH_VALIDATE_LOOP_INDEXING, translate(), TParseContext::treeRoot, and validateLimitations().

Referenced by ShCompile().

bool TCompiler::detectCallDepth | ( | TIntermNode * | root,
|  | TInfoSink & | infoSink,
|  | bool | limitCallStackDepth
| ) |  |

protected

Definition at line 262 of file Compiler.cpp.

References DetectCallDepth::detectCallDepth(), EPrefixError, TInfoSink::info, DetectCallDepth::kErrorMaxDepthExceeded, DetectCallDepth::kErrorMissingMain, DetectCallDepth::kErrorNone, DetectCallDepth::kErrorRecursion, TInfoSinkBase::prefix(), TIntermNode::traverse(), and UNREACHABLE.

Referenced by compile().

bool TCompiler::enforceFragmentShaderTimingRestrictions | ( | const TDependencyGraph & | graph | ) |

protected

Definition at line 347 of file Compiler.cpp.

References RestrictFragmentShaderTiming::enforceRestrictions(), TInfoSink::info, and RestrictFragmentShaderTiming::numErrors().

Referenced by enforceTimingRestrictions().

bool TCompiler::enforcePackingRestrictions | ( |  | ) |

protected

Definition at line 367 of file Compiler.cpp.

References VariablePacker::CheckVariablesWithinPackingLimits().

Referenced by compile().

bool TCompiler::enforceTimingRestrictions | ( | TIntermNode * | root,
|  | bool | outputGraph
| ) |  |

protected

Definition at line 299 of file Compiler.cpp.

References enforceFragmentShaderTimingRestrictions(), enforceVertexShaderTimingRestrictions(), TInfoSink::info, sort_controllers::output, TDependencyGraphOutput::outputAllSpanningTrees(), SH_FRAGMENT_SHADER, and SH_WEBGL_SPEC.

Referenced by compile().

bool TCompiler::enforceVertexShaderTimingRestrictions | ( | TIntermNode * | root | ) |

protected

Definition at line 354 of file Compiler.cpp.

References RestrictVertexShaderTiming::enforceRestrictions(), TInfoSink::info, and RestrictVertexShaderTiming::numErrors().

Referenced by enforceTimingRestrictions().

const ArrayBoundsClamper & TCompiler::getArrayBoundsClamper | ( |  | ) | const

protected

Definition at line 395 of file Compiler.cpp.

Referenced by TranslatorESSL::translate(), and TranslatorGLSL::translate().

ShArrayIndexClampingStrategy TCompiler::getArrayIndexClampingStrategy | ( |  | ) | const

protected

Definition at line 400 of file Compiler.cpp.

Referenced by TranslatorESSL::translate(), and TranslatorGLSL::translate().

virtual TCompiler* TCompiler::getAsCompiler | ( |  | ) |

inlinevirtual

Reimplemented from TShHandleBase.

Definition at line 62 of file ShHandle.h.

const TVariableInfoList& TCompiler::getAttribs | ( |  | ) | const

inline

Definition at line 71 of file ShHandle.h.

Referenced by getVariableInfo(), and ShGetInfo().

const BuiltInFunctionEmulator & TCompiler::getBuiltInFunctionEmulator | ( |  | ) | const

protected

Definition at line 405 of file Compiler.cpp.

Referenced by TranslatorESSL::translate(), and TranslatorGLSL::translate().

const TExtensionBehavior & TCompiler::getExtensionBehavior | ( |  | ) | const

protected

Definition at line 385 of file Compiler.cpp.

ShHashFunction64 TCompiler::getHashFunction | ( |  | ) | const

inline

Definition at line 75 of file ShHandle.h.

Referenced by ShGetInfo(), TranslatorGLSL::translate(), and TranslatorESSL::translate().

TInfoSink& TCompiler::getInfoSink | ( |  | ) |

inline

Definition at line 70 of file ShHandle.h.

Referenced by ShGetInfo(), ShGetInfoLog(), ShGetObjectCode(), TranslatorESSL::translate(), and TranslatorGLSL::translate().

int TCompiler::getMappedNameMaxLength | ( |  | ) | const

Definition at line 380 of file Compiler.cpp.

References MAX_SHORTENED_IDENTIFIER_SIZE.

NameMap& TCompiler::getNameMap | ( |  | ) |

inline

Definition at line 76 of file ShHandle.h.

Referenced by ShGetInfo(), ShGetNameHashingEntry(), TranslatorESSL::translate(), and TranslatorGLSL::translate().

const ShBuiltInResources & TCompiler::getResources | ( |  | ) | const

protected

Definition at line 390 of file Compiler.cpp.

Referenced by TranslatorHLSL::translate().

ShShaderSpec TCompiler::getShaderSpec | ( |  | ) | const

inlineprotected

Definition at line 81 of file ShHandle.h.

ShShaderType TCompiler::getShaderType | ( |  | ) | const

inlineprotected

Definition at line 80 of file ShHandle.h.

Referenced by TranslatorESSL::translate(), and TranslatorGLSL::translate().

TSymbolTable& TCompiler::getSymbolTable | ( |  | ) |

inline

Definition at line 77 of file ShHandle.h.

Referenced by TranslatorESSL::translate(), and TranslatorGLSL::translate().

const TVariableInfoList& TCompiler::getUniforms | ( |  | ) | const

inline

Definition at line 72 of file ShHandle.h.

Referenced by getVariableInfo(), and ShGetInfo().

bool TCompiler::Init | ( | const ShBuiltInResources & | resources | ) |

Definition at line 77 of file Compiler.cpp.

References ShBuiltInResources::ArrayIndexClampingStrategy, ShBuiltInResources::FragmentPrecisionHigh, ShBuiltInResources::HashFunction, InitBuiltInSymbolTable(), InitExtensionBehavior(), ShBuiltInResources::MaxCallStackDepth, ShBuiltInResources::MaxExpressionComplexity, ShBuiltInResources::MaxFragmentUniformVectors, ShBuiltInResources::MaxVertexUniformVectors, ArrayBoundsClamper::SetClampingStrategy(), and SH_VERTEX_SHADER.

Referenced by ShConstructCompiler().

bool TCompiler::InitBuiltInSymbolTable | ( | const ShBuiltInResources & | resources | ) |

protected

Definition at line 209 of file Compiler.cpp.

References TPublicType::array, assert, EbpHigh, EbpMedium, EbtFloat, EbtInt, IdentifyBuiltIns(), InsertBuiltInFunctions(), TSymbolTable::isEmpty(), TPublicType::matrix, TSymbolTable::push(), TSymbolTable::setDefaultPrecision(), SH_FRAGMENT_SHADER, SH_VERTEX_SHADER, TPublicType::size, and TPublicType::type.

Referenced by Init().

bool TCompiler::limitExpressionComplexity | ( | TIntermNode * | root | ) |

protected

Definition at line 325 of file Compiler.cpp.

References TDependencyGraph::beginUserDefinedFunctionCalls(), TDependencyGraph::endUserDefinedFunctionCalls(), TIntermTraverser::getMaxDepth(), TInfoSink::info, TGraphFunctionCall::traverse(), and TIntermNode::traverse().

Referenced by compile().

void TCompiler::mapLongVariableNames | ( | TIntermNode * | root | ) |

protected

Definition at line 373 of file Compiler.cpp.

References ASSERT, map, and TIntermNode::traverse().

Referenced by compile().

void TCompiler::rewriteCSSShader | ( | TIntermNode * | root | ) |

protected

Definition at line 287 of file Compiler.cpp.

References TIntermNode::traverse().

Referenced by compile().

virtual void TCompiler::translate | ( | TIntermNode * | root | ) |

protectedpure virtual

Implemented in TranslatorHLSL, TranslatorESSL, and TranslatorGLSL.

Referenced by compile().

bool TCompiler::validateLimitations | ( | TIntermNode * | root | ) |

protected

Definition at line 293 of file Compiler.cpp.

References TInfoSink::info, ValidateLimitations::numErrors(), and TIntermNode::traverse().

Referenced by compile().

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

- zenilib/jni/external/angle/src/compiler/ShHandle.h
- zenilib/jni/external/angle/src/compiler/Compiler.cpp