Search
lxdream.org :: lxdream :: r1229:dc935eee9767
lxdream 0.9.1
released Jun 29
Download Now
changeset1229:dc935eee9767
parent1228:8168aa94e6d7
child1231:d63c808ddcd3
authornkeynes
dateThu Feb 23 19:43:24 2012 +1000 (8 years ago)
Add missing float uniform type
Fix previous sl cleanup being called after new sl setup is done
src/pvr2/gl_sl.c
src/tools/genglsl.c
1.1 --- a/src/pvr2/gl_sl.c Thu Feb 23 15:24:47 2012 +1000
1.2 +++ b/src/pvr2/gl_sl.c Thu Feb 23 19:43:24 2012 +1000
1.3 @@ -167,6 +167,7 @@
1.4
1.5 #define glsl_set_uniform_sampler1D(id,v) glUniform1iARB(id,v)
1.6 #define glsl_set_uniform_sampler2D(id,v) glUniform1iARB(id,v)
1.7 +#define glsl_set_uniform_float(id,v) glUniform1fARB(id,v)
1.8 #define glsl_set_uniform_vec3(id,v) glUniform3fvARB(id,1,v)
1.9 #define glsl_set_uniform_vec4(id,v) glUniform4fvARB(id,1,v)
1.10 #define glsl_set_uniform_mat4(id,v) glUniformMatrix4fvARB(id,1,GL_FALSE,v)
1.11 @@ -294,6 +295,7 @@
1.12
1.13 #define glsl_set_uniform_sampler1D(id,v) glUniform1i(id,v)
1.14 #define glsl_set_uniform_sampler2D(id,v) glUniform1i(id,v)
1.15 +#define glsl_set_uniform_float(id,v) glUniform1f(id,v)
1.16 #define glsl_set_uniform_vec3(id,v) glUniform3fv(id,1,v)
1.17 #define glsl_set_uniform_vec4(id,v) glUniform4fv(id,1,v)
1.18 #define glsl_set_uniform_mat4(id,v) glUniformMatrix4fv(id,1,GL_FALSE,v)
1.19 @@ -351,7 +353,9 @@
1.20 return 0;
1.21 }
1.22
1.23 +#define glsl_set_uniform_sampler1D(id,v)
1.24 #define glsl_set_uniform_sampler2D(id,v)
1.25 +#define glsl_set_uniform_float(id,v)
1.26 #define glsl_set_uniform_vec3(id,v)
1.27 #define glsl_set_uniform_vec4(id,v)
1.28 #define glsl_set_uniform_mat4(id,v)
2.1 --- a/src/tools/genglsl.c Thu Feb 23 15:24:47 2012 +1000
2.2 +++ b/src/tools/genglsl.c Thu Feb 23 19:43:24 2012 +1000
2.3 @@ -244,6 +244,7 @@
2.4
2.5 static const char *sl_type_map[][3] = {
2.6 {"int", "int", "int *"},
2.7 + {"float", "float", "float *"},
2.8 {"short", "short", "short *"},
2.9 {"sampler", "int", "int *"},
2.10 {"vec", "GLfloat *", "GLfloat *"},
2.11 @@ -387,13 +388,13 @@
2.12
2.13 fprintf( f, "\nvoid glsl_use_%s() {\n", program->name );
2.14 fprintf( f, " glsl_use_program(prog_%s_id);\n", program->name );
2.15 + fprintf( f, " glsl_set_cleanup_fn(glsl_cleanup_%s);\n", program->name );
2.16 for( var_ptr = program->variables; var_ptr != NULL; var_ptr = var_ptr->next ) {
2.17 variable_t var = var_ptr->data;
2.18 if( !var->uniform ) {
2.19 fprintf( f, " glsl_enable_attrib(var_%s_%s_loc);\n", program->name, var->name );
2.20 }
2.21 }
2.22 - fprintf( f, " glsl_set_cleanup_fn(glsl_cleanup_%s);\n", program->name );
2.23 fprintf( f, "}\n");
2.24
2.25
.