diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-24 13:37:06 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-24 13:39:13 +0100 |
commit | 34aba4724f196e34ed02cf50073f41968f119bb6 (patch) | |
tree | 0ebdfcabda989ab76ee6de53c6461553c7a767a5 /src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp | |
parent | b86b2a742afae118bf974c82ba966ddb0cae4afb (diff) | |
parent | b1cf07f495e10c93e53651ac03e46ebdaea0a97e (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/corelib/io/qiodevice.cpp
src/plugins/bearer/linux_common/qofonoservice_linux.cpp
src/plugins/bearer/linux_common/qofonoservice_linux_p.h
src/plugins/platforms/android/qandroidplatformtheme.cpp
src/tools/bootstrap/bootstrap.pro
src/widgets/styles/qmacstyle_mac.mm
Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp')
-rw-r--r-- | src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp b/src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp index 4b2aecab33..6acbf7c5a8 100644 --- a/src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp +++ b/src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp @@ -9,18 +9,6 @@ #include "compiler/translator/OutputGLSL.h" #include "compiler/translator/VersionGLSL.h" -static void writeVersion(sh::GLenum type, TIntermNode* root, - TInfoSinkBase& sink) { - TVersionGLSL versionGLSL(type); - root->traverse(&versionGLSL); - int version = versionGLSL.getVersion(); - // We need to write version directive only if it is greater than 110. - // If there is no version directive in the shader, 110 is implied. - if (version > 110) { - sink << "#version " << version << "\n"; - } -} - TranslatorGLSL::TranslatorGLSL(sh::GLenum type, ShShaderSpec spec) : TCompiler(type, spec, SH_GLSL_OUTPUT) { } @@ -29,7 +17,9 @@ void TranslatorGLSL::translate(TIntermNode* root) { TInfoSinkBase& sink = getInfoSink().obj; // Write GLSL version. - writeVersion(getShaderType(), root, sink); + writeVersion(root); + + writePragma(); // Write extension behaviour as needed writeExtensionBehavior(); @@ -46,6 +36,20 @@ void TranslatorGLSL::translate(TIntermNode* root) { root->traverse(&outputGLSL); } +void TranslatorGLSL::writeVersion(TIntermNode *root) +{ + TVersionGLSL versionGLSL(getShaderType(), getPragma()); + root->traverse(&versionGLSL); + int version = versionGLSL.getVersion(); + // We need to write version directive only if it is greater than 110. + // If there is no version directive in the shader, 110 is implied. + if (version > 110) + { + TInfoSinkBase& sink = getInfoSink().obj; + sink << "#version " << version << "\n"; + } +} + void TranslatorGLSL::writeExtensionBehavior() { TInfoSinkBase& sink = getInfoSink().obj; const TExtensionBehavior& extensionBehavior = getExtensionBehavior(); |