diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp')
-rw-r--r-- | src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp b/src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp index 238bc97576..76d006fd11 100644 --- a/src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp +++ b/src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp @@ -8,6 +8,7 @@ #include "compiler/translator/BuiltInFunctionEmulatorGLSL.h" #include "compiler/translator/EmulatePrecision.h" +#include "compiler/translator/RecordConstantPrecision.h" #include "compiler/translator/OutputESSL.h" #include "angle_gl.h" @@ -19,16 +20,18 @@ TranslatorESSL::TranslatorESSL(sh::GLenum type, ShShaderSpec spec) void TranslatorESSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions) { if (compileOptions & SH_EMULATE_BUILT_IN_FUNCTIONS) - InitBuiltInFunctionEmulatorForGLSL(emu, getShaderType()); + { + InitBuiltInFunctionEmulatorForGLSLWorkarounds(emu, getShaderType()); + } } void TranslatorESSL::translate(TIntermNode *root, int) { TInfoSinkBase& sink = getInfoSink().obj; - int shaderVersion = getShaderVersion(); - if (shaderVersion > 100) + int shaderVer = getShaderVersion(); + if (shaderVer > 100) { - sink << "#version " << shaderVersion << " es\n"; + sink << "#version " << shaderVer << " es\n"; } writePragma(); @@ -40,12 +43,14 @@ void TranslatorESSL::translate(TIntermNode *root, int) { if (precisionEmulation) { - EmulatePrecision emulatePrecision; + EmulatePrecision emulatePrecision(getSymbolTable(), shaderVer); root->traverse(&emulatePrecision); emulatePrecision.updateTree(); emulatePrecision.writeEmulationHelpers(sink, SH_ESSL_OUTPUT); } + RecordConstantPrecision(root, getTemporaryIndex()); + // Write emulated built-in functions if needed. if (!getBuiltInFunctionEmulator().IsOutputEmpty()) { @@ -71,13 +76,8 @@ void TranslatorESSL::translate(TIntermNode *root, int) { getArrayBoundsClamper().OutputClampingFunctionDefinition(sink); // Write translated shader. - TOutputESSL outputESSL(sink, - getArrayIndexClampingStrategy(), - getHashFunction(), - getNameMap(), - getSymbolTable(), - shaderVersion, - precisionEmulation); + TOutputESSL outputESSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), + getSymbolTable(), shaderVer, precisionEmulation); root->traverse(&outputESSL); } |