glsl: fix the type of ir_constant_data::u16
[mesa.git] / src / compiler / glsl / main.cpp
index 1e5e0febcd900faea2068f6a78bec477a167f5c4..c826c279fac02490adbd58e1bd0ddb956c80a313 100644 (file)
@@ -21,6 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <stdlib.h>
 #include <stdio.h>
 #include <getopt.h>
 
@@ -42,8 +43,10 @@ const struct option compiler_opts[] = {
    { "dump-ast", no_argument, &options.dump_ast, 1 },
    { "dump-hir", no_argument, &options.dump_hir, 1 },
    { "dump-lir", no_argument, &options.dump_lir, 1 },
+   { "dump-builder", no_argument, &options.dump_builder, 1 },
    { "link",     no_argument, &options.do_link,  1 },
    { "just-log", no_argument, &options.just_log, 1 },
+   { "lower-precision", no_argument, &options.lower_precision, 1 },
    { "version",  required_argument, NULL, 'v' },
    { NULL, 0, NULL, 0 }
 };
@@ -51,7 +54,7 @@ const struct option compiler_opts[] = {
 /**
  * \brief Print proper usage and exit with failure.
  */
-void
+static void
 usage_fail(const char *name)
 {
 
@@ -61,7 +64,10 @@ usage_fail(const char *name)
       "Possible options are:\n";
    printf(header, name);
    for (const struct option *o = compiler_opts; o->name != 0; ++o) {
-      printf("    --%s\n", o->name);
+      printf("    --%s", o->name);
+      if (o->has_arg == required_argument)
+         printf(" (mandatory)");
+      printf("\n");
    }
    exit(EXIT_FAILURE);
 }
@@ -87,8 +93,10 @@ main(int argc, char * const* argv)
       usage_fail(argv[0]);
 
    struct gl_shader_program *whole_program;
+   static struct gl_context local_ctx;
 
-   whole_program = standalone_compile_shader(&options, argc - optind, &argv[optind]);
+   whole_program = standalone_compile_shader(&options, argc - optind,
+                                             &argv[optind], &local_ctx);
 
    if (!whole_program)
       usage_fail(argv[0]);