summaryrefslogtreecommitdiff
path: root/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch
diff options
context:
space:
mode:
Diffstat (limited to 'external/libgltf/patches/shader_charbuffer_used_as_cstring.patch')
-rw-r--r--external/libgltf/patches/shader_charbuffer_used_as_cstring.patch54
1 files changed, 27 insertions, 27 deletions
diff --git a/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch b/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch
index 000796c2f9f4..145cccc26cdc 100644
--- a/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch
+++ b/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch
@@ -1,7 +1,7 @@
diff -ur libgltf.org/src/Common.cpp libgltf/src/Common.cpp
---- libgltf.org/src/Common.cpp 2014-04-20 10:46:20.065036606 +0200
-+++ libgltf/src/Common.cpp 2014-04-20 12:12:26.940821223 +0200
-@@ -521,8 +521,10 @@
+--- libgltf.org/src/Common.cpp 2014-05-05 15:02:17.155439207 +0200
++++ libgltf/src/Common.cpp 2014-05-05 15:04:25.631444687 +0200
+@@ -518,8 +518,10 @@
if(vShaderIdx >= 0 && fShaderIdx >= 0)
{
const char* pvShader = pGltfHandle->files[vShaderIdx]->buffer;
@@ -14,10 +14,10 @@ diff -ur libgltf.org/src/Common.cpp libgltf/src/Common.cpp
if (0 != mProgramId)
{
diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp
---- libgltf.org/src/Shaders.cpp 2014-04-20 10:46:20.065036606 +0200
-+++ libgltf/src/Shaders.cpp 2014-04-20 12:15:42.683813064 +0200
-@@ -110,12 +110,12 @@
- return programId;
+--- libgltf.org/src/Shaders.cpp 2014-05-05 15:02:17.155439207 +0200
++++ libgltf/src/Shaders.cpp 2014-05-05 15:09:30.143457676 +0200
+@@ -105,12 +105,12 @@
+ return programId;
}
-unsigned int ShaderProgram::createProgram(const char* pvShader, const char* pfShader)
@@ -32,17 +32,17 @@ diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp
return 0;
return programId;
-@@ -142,7 +142,7 @@
- return false;
- }
+@@ -137,7 +137,7 @@
+ return false;
+ }
-- if (!compileShader(shaderCode.c_str(), shaderId))
-+ if (!compileShader(shaderCode.c_str(), shader.length(), shaderId))
- {
- std::cout << "compileShader : compileShader failed." << std::endl;
- return false;
-@@ -158,11 +158,11 @@
- return true;
+- if (!compileShader(shaderCode.c_str(), shaderId))
++ if (!compileShader(shaderCode.c_str(), shader.length(), shaderId))
+ {
+ std::cout << "compileShader : compileShader failed." << std::endl;
+ return false;
+@@ -153,11 +153,11 @@
+ return true;
}
-bool ShaderProgram::loadShader(unsigned int programId, const char* pShader, int type)
@@ -55,22 +55,22 @@ diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp
{
std::cout << "compileShader : compileShader failed." << std::endl;
return false;
-@@ -178,9 +178,10 @@
+@@ -173,9 +173,10 @@
return true;
}
-bool ShaderProgram::compileShader(const char* pShader, unsigned int shaderId)
+bool ShaderProgram::compileShader(const char* pShader, size_t iSize, unsigned int shaderId)
{
-- glShaderSource(shaderId, 1, &pShader, NULL);
-+ GLint iGLSize = iSize;
-+ glShaderSource(shaderId, 1, &pShader, &iGLSize);
- glCompileShader(shaderId);
- int iStatus = 0;
- glGetShaderiv(shaderId, GL_COMPILE_STATUS, &iStatus);
+- glShaderSource(shaderId, 1, &pShader, NULL);
++ GLint iGLSize = iSize;
++ glShaderSource(shaderId, 1, &pShader, &iGLSize);
+ glCompileShader(shaderId);
+ int iStatus = 0;
+ glGetShaderiv(shaderId, GL_COMPILE_STATUS, &iStatus);
diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h
---- libgltf.org/src/Shaders.h 2014-04-20 10:46:20.065036606 +0200
-+++ libgltf/src/Shaders.h 2014-04-20 12:11:36.816823313 +0200
+--- libgltf.org/src/Shaders.h 2014-05-05 15:02:17.155439207 +0200
++++ libgltf/src/Shaders.h 2014-05-05 15:10:26.003460059 +0200
@@ -39,17 +39,17 @@
void setUniform(unsigned int uProgId, const char* name, const glm::mat4 mMatrix);
@@ -84,7 +84,7 @@ diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h
bool loadShader(unsigned int programId, const std::string& shaderName, int type);
- bool loadShader(unsigned int programId, const char* pShader, int type);
-+ bool loadShader(unsigned int programId, const char* pShader, size_t iSize, int type);
++ bool loadShader(unsigned int programId, const char* pShader, size_t iSize, int type);;
private:
- bool compileShader(const char* pShader, unsigned int shaderId);