Commit 1ade24db by Olli Etuaho

Add #version 300 es to ESSL output when needed

BUG=angleproject:953 Change-Id: Ib9e45fab1d35f8c78abd0ac2209ac4f63afe4465 Reviewed-on: https://chromium-review.googlesource.com/261170Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org>
parent d6b14287
...@@ -25,6 +25,12 @@ void TranslatorESSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, i ...@@ -25,6 +25,12 @@ void TranslatorESSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, i
void TranslatorESSL::translate(TIntermNode *root, int) { void TranslatorESSL::translate(TIntermNode *root, int) {
TInfoSinkBase& sink = getInfoSink().obj; TInfoSinkBase& sink = getInfoSink().obj;
int shaderVersion = getShaderVersion();
if (shaderVersion > 100)
{
sink << "#version " << shaderVersion << " es\n";
}
writePragma(); writePragma();
// Write built-in extension behaviors. // Write built-in extension behaviors.
...@@ -70,7 +76,7 @@ void TranslatorESSL::translate(TIntermNode *root, int) { ...@@ -70,7 +76,7 @@ void TranslatorESSL::translate(TIntermNode *root, int) {
getHashFunction(), getHashFunction(),
getNameMap(), getNameMap(),
getSymbolTable(), getSymbolTable(),
getShaderVersion(), shaderVersion,
precisionEmulation); precisionEmulation);
root->traverse(&outputESSL); root->traverse(&outputESSL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment