summaryrefslogtreecommitdiffstats
path: root/external/libgltf
diff options
context:
space:
mode:
Diffstat (limited to 'external/libgltf')
-rw-r--r--external/libgltf/UnpackedTarball_libgltf.mk1
-rw-r--r--external/libgltf/pathces/append_shader_version.patch37
2 files changed, 38 insertions, 0 deletions
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk
index 3b27c2a46b01..42c821bbe819 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1))
$(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
external/libgltf/pathces/missing_include.patch \
+ external/libgltf/pathces/append_shader_version.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/pathces/append_shader_version.patch b/external/libgltf/pathces/append_shader_version.patch
new file mode 100644
index 000000000000..27f0cc66ee36
--- /dev/null
+++ b/external/libgltf/pathces/append_shader_version.patch
@@ -0,0 +1,37 @@
+diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp
+--- 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>
+ #include <cstdio>
++#include <cstring>
+
+ namespace libgltf
+ {
+@@ -166,7 +167,24 @@
+ unsigned int shaderId)
+ {
+ GLint iGLSize = iSize;
+- glShaderSource(shaderId, 1, &pShader, &iGLSize);
++ if( strstr(pShader,"#version") == 0 )
++ {
++ const GLchar* aSources[] = {
++ "#version 130\n",
++ pShader,
++ };
++
++ const GLint aSizes[] = {
++ strlen("#version 130\n"),
++ iGLSize,
++ };
++
++ glShaderSource(shaderId, 2, &aSources[0], &aSizes[0]);
++ }
++ else
++ {
++ glShaderSource(shaderId, 1, &pShader, &iGLSize);
++ }
+ glCompileShader(shaderId);
+ int iStatus = 0;
+ glGetShaderiv(shaderId, GL_COMPILE_STATUS, &iStatus);