mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
GLSL: unlimit shader file size. [R. Belmont]
This commit is contained in:
parent
e670fe9846
commit
cda571268b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user