GLSL: unlimit shader file size. [R. Belmont]

This commit is contained in:
arbee 2015-06-13 14:31:36 -04:00
parent e670fe9846
commit cda571268b

View File

@ -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);