diff options
author | Oliver Wolff <oliver.wolff@theqtcompany.com> | 2016-03-24 12:38:18 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2016-04-25 05:57:38 +0000 |
commit | e12ba07322cd61c5cf50c25ed8d1f08f6b1ff879 (patch) | |
tree | d31a44c9f123ed764a00eff7b4fff656a07d54ab /src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp | |
parent | d3dcc6f610b97be7cbfbb0a65988e5940568c825 (diff) |
Update ANGLE to chromium/2651
Change-Id: I1cd32b780b1a0b913fab870e155ae1f4f9ac40d7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
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); } |