[Libreoffice-commits] core.git: external/libgltf

Zolnai Tamás tamas.zolnai at collabora.com
Mon Aug 18 00:28:21 PDT 2014


 external/libgltf/patches/append_shader_version.patch |   31 +++++++++++--------
 1 file changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 6be202585f201deaf07c57e0f2cf722cce91165e
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Mon Aug 18 09:24:23 2014 +0200

    libgltf: check for #version string in the shader before add an own one.
    
    Change-Id: I69dbbabc5774cbce7943e77f41bb42ed7a118bcf

diff --git a/external/libgltf/patches/append_shader_version.patch b/external/libgltf/patches/append_shader_version.patch
index dd79515..27f0cc6 100644
--- a/external/libgltf/patches/append_shader_version.patch
+++ b/external/libgltf/patches/append_shader_version.patch
@@ -1,6 +1,6 @@
 diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp
---- libgltf.org/src/Shaders.cpp	2014-08-17 09:15:17.379255115 +0200
-+++ libgltf/src/Shaders.cpp	2014-08-17 09:16:43.323258781 +0200
+--- libgltf.org/src/Shaders.cpp	2014-08-18 09:19:48.323955939 +0200
++++ libgltf/src/Shaders.cpp	2014-08-18 09:20:46.711953465 +0200
 @@ -11,6 +11,7 @@
  
  #include <GL/glew.h>
@@ -9,22 +9,29 @@ diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp
  
  namespace libgltf
  {
-@@ -166,7 +167,17 @@
+@@ -166,7 +167,24 @@
                                    unsigned int shaderId)
  {
      GLint iGLSize = iSize;
 -    glShaderSource(shaderId, 1, &pShader, &iGLSize);
-+    const GLchar* aSources[] = {
-+        "#version 130\n",
-+        pShader,
-+    };
++    if( strstr(pShader,"#version") == 0 )
++    {
++        const GLchar* aSources[] = {
++            "#version 130\n",
++            pShader,
++        };
 +
-+    const GLint aSizes[] = {
-+        strlen("#version 130\n"),
-+        iGLSize,
-+    };
++        const GLint aSizes[] = {
++            strlen("#version 130\n"),
++            iGLSize,
++        };
 +
-+    glShaderSource(shaderId, 2, &aSources[0], &aSizes[0]);
++        glShaderSource(shaderId, 2, &aSources[0], &aSizes[0]);
++    }
++    else
++    {
++        glShaderSource(shaderId, 1, &pShader, &iGLSize);
++    }
      glCompileShader(shaderId);
      int iStatus = 0;
      glGetShaderiv(shaderId, GL_COMPILE_STATUS, &iStatus);


More information about the Libreoffice-commits mailing list