Kaydet (Commit) d4fccd7d authored tarafından Zolnai Tamás's avatar Zolnai Tamás

collada2gltf: it seems better not to add #version to glTF shader files

Here only handle precision. Using precision unconditionally
causing problems when shader source is compiled with GLSL 1.2.
The #version dircetives can be added by the glTF parser.
For example libgltf implementation:
https://gerrit.libreoffice.org/gitweb?p=libgltf.git;a=commit;
h=e4544a8b5ca8470a96bf28c6ccdb7461e78ca293

Change-Id: I934cdfa8651a8787fbcd476cea9892bf7e89dd11
üst e99535df
diff -ur collada2gltf.org/shaders/commonProfileShaders.cpp collada2gltf/shaders/commonProfileShaders.cpp
--- collada2gltf.org/shaders/commonProfileShaders.cpp 2014-08-15 15:21:51.839323947 +0200
+++ collada2gltf/shaders/commonProfileShaders.cpp 2014-08-15 15:23:36.931327850 +0200
@@ -367,7 +367,7 @@
--- collada2gltf.org/shaders/commonProfileShaders.cpp 2014-08-17 08:57:52.187210533 +0200
+++ collada2gltf/shaders/commonProfileShaders.cpp 2014-08-17 08:59:48.427215491 +0200
@@ -367,7 +367,9 @@
public:
GLSLShader(shared_ptr <GLTFProfile> profile) {
- this->_declarations = "precision highp float;\n";;
+ this->_declarations = "#ifdef GL_ES_VERSION_2_0\n#version 100\n#else\n#version 130\n#endif\nprecision highp float;\n";
+ this->_declarations = "#ifdef GL_ES_VERSION_2_0\n";
+ this->_declarations += "precision highp float;\n";
+ this->_declarations += "#endif\n";
this->_body = "void main(void) {\n";
this->_profile = profile;
}
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