X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg_build_utils_shader.h;h=1c81c41822dd0532a4273c14bebdae3d97a3ea54;hb=ff8e8a170cb29b450f7f26580683ec3ae81cf4bd;hp=77ce897e4f32297706aa692b2b9ff670b10742c5;hpb=76f30a0f4aef82c10b4affbeab3f0271936ce7ca;p=vg.git diff --git a/vg_build_utils_shader.h b/vg_build_utils_shader.h index 77ce897..1c81c41 100644 --- a/vg_build_utils_shader.h +++ b/vg_build_utils_shader.h @@ -35,6 +35,8 @@ static void vg_shader_set_include_dir( char *dir ) static void parse_uniform_name( char *start, struct uniform *uf ) { uf->array = 0; + int type_set = 0; + for( int i=0;; i++ ) { if( start[i] == '\0' ) @@ -56,7 +58,12 @@ static void parse_uniform_name( char *start, struct uniform *uf ) if( start[i] == ' ' ) { start[i] = '\0'; - strncpy( uf->type, start, sizeof(uf->type) ); + + if( !type_set ) + { + strncpy( uf->type, start, sizeof(uf->type) ); + type_set = 1; + } start = start+i+1; i=0; } @@ -80,7 +87,9 @@ static int compile_subshader( FILE *header, char *name ) else { fprintf( header, "{\n" - ".static_src = \n" ); + ".orig_file = \"%s\",\n" + ".static_src = \n", + name ); char *cur = full, *start = full; while( 1 ) @@ -199,7 +208,8 @@ int vg_build_shader( char *src_vert, /* path/to/vert.vs */ for( int i=0; iarray ) continue; + if( uf->array ) + continue; for( int j=0; j