mesa: initial support for ARB_geometry_shader4
[mesa.git] / src / glsl / apps / compile.c
index c9a830b9f3ce6f2b8b0d6c7c1b527d58c5fb0b64..5073b0da827ba5634ed9d68edc1fd1cbc43c3750 100644 (file)
@@ -37,7 +37,7 @@ static void
 usage(void)
 {
    printf("Usage:\n");
-   printf("  compile fragment|vertex <source> <output>\n");
+   printf("  compile fragment|vertex|geometry <source> <output>\n");
 }
 
 int
@@ -65,6 +65,8 @@ main(int argc,
       shader_type = 1;
    } else if (!strcmp(argv[1], "vertex")) {
       shader_type = 2;
+   } else if (!strcmp(argv[1], "geometry")) {
+      shader_type = 3;
    } else {
       usage();
       return 1;
@@ -79,6 +81,7 @@ main(int argc,
 
    fseek(in, 0, SEEK_END);
    size = ftell(in);
+   assert(size != -1);
    fseek(in, 0, SEEK_SET);
 
    out = fopen(argv[3], "w");
@@ -134,8 +137,8 @@ main(int argc,
       return 0;
    }
 
-   if (sl_pp_context_add_extension(context, "ARB_draw_buffers", "GL_ARB_draw_buffers") ||
-       sl_pp_context_add_extension(context, "ARB_texture_rectangle", "GL_ARB_texture_rectangle")) {
+   if (sl_pp_context_add_extension(context, "GL_ARB_draw_buffers") ||
+       sl_pp_context_add_extension(context, "GL_ARB_texture_rectangle")) {
       fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context));
 
       printf("Error: %s\n", sl_pp_context_error_message(context));