summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2015-06-13 14:31:36 -0400
committer arbee <rb6502@users.noreply.github.com>2015-06-13 14:31:36 -0400
commitcda571268bf95789c1fc1044c284c4fe06bbc0e4 (patch)
tree7139bff09de381109c1e53d18ff8767391dd8d26
parente670fe9846df782077dfec6e59d2bad563cc338f (diff)
GLSL: unlimit shader file size. [R. Belmont]
-rw-r--r--src/osd/modules/opengl/gl_shader_tool.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osd/modules/opengl/gl_shader_tool.c b/src/osd/modules/opengl/gl_shader_tool.c
index abf1420f77a..5d308882ed8 100644
--- a/src/osd/modules/opengl/gl_shader_tool.c
+++ b/src/osd/modules/opengl/gl_shader_tool.c
@@ -376,7 +376,7 @@ int gl_compile_shader_file( GLhandleARB *shader, GLenum type, const char * shade
{
int err = 0, i, c;
FILE * file = NULL;
- const int buffer_len=8192;
+ int buffer_len = 8192;
GLcharARB *buffer=NULL;
if(shader==NULL || shader_file==NULL)
@@ -395,6 +395,11 @@ int gl_compile_shader_file( GLhandleARB *shader, GLenum type, const char * shade
return -1;
}
+ // get the real file size
+ fseek(file, 0, SEEK_END);
+ buffer_len = (int)ftell(file);
+ fseek(file, 0, SEEK_SET);
+
buffer = (GLcharARB *) malloc(buffer_len);
memset(buffer, 0, buffer_len);