- memset(&s, 0, sizeof(s));
- memset(&v, 0, sizeof(v));
-
- /* cmdline args which impact shader variant get spit out in a
- * comment on the first line.. a quick/dirty way to preserve
- * that info so when ir3test recompiles the shader with a new
- * compiler version, we use the same shader-key settings:
- */
- debug_printf("; options:");
-
- while (n < argc) {
- if (!strcmp(argv[n], "--verbose")) {
- fd_mesa_debug |= FD_DBG_MSGS | FD_DBG_OPTMSGS | FD_DBG_DISASM;
- n++;
- continue;
- }
-
- if (!strcmp(argv[n], "--binning-pass")) {
- debug_printf(" %s", argv[n]);
- key.binning_pass = true;
- n++;
- continue;
- }
-
- if (!strcmp(argv[n], "--color-two-side")) {
- debug_printf(" %s", argv[n]);
- key.color_two_side = true;
- n++;
- continue;
- }
-
- if (!strcmp(argv[n], "--half-precision")) {
- debug_printf(" %s", argv[n]);
- key.half_precision = true;
- n++;
- continue;
- }
-
- if (!strcmp(argv[n], "--saturate-s")) {
- debug_printf(" %s %s", argv[n], argv[n+1]);
- key.vsaturate_s = key.fsaturate_s = strtol(argv[n+1], NULL, 0);
- n += 2;
- continue;
- }
-
- if (!strcmp(argv[n], "--saturate-t")) {
- debug_printf(" %s %s", argv[n], argv[n+1]);
- key.vsaturate_t = key.fsaturate_t = strtol(argv[n+1], NULL, 0);
- n += 2;
- continue;
- }
-
- if (!strcmp(argv[n], "--saturate-r")) {
- debug_printf(" %s %s", argv[n], argv[n+1]);
- key.vsaturate_r = key.fsaturate_r = strtol(argv[n+1], NULL, 0);
- n += 2;
- continue;
- }
-
- if (!strcmp(argv[n], "--astc-srgb")) {
- debug_printf(" %s %s", argv[n], argv[n+1]);
- key.vastc_srgb = key.fastc_srgb = strtol(argv[n+1], NULL, 0);
- n += 2;
- continue;
- }
-
- if (!strcmp(argv[n], "--stream-out")) {
- struct pipe_stream_output_info *so = &s.stream_output;
- debug_printf(" %s", argv[n]);
- /* TODO more dynamic config based on number of outputs, etc
- * rather than just hard-code for first output:
- */
- so->num_outputs = 1;
- so->stride[0] = 4;
- so->output[0].register_index = 0;
- so->output[0].start_component = 0;
- so->output[0].num_components = 4;
- so->output[0].output_buffer = 0;
- so->output[0].dst_offset = 2;
- so->output[0].stream = 0;
- n++;
- continue;
- }
-
- if (!strcmp(argv[n], "--ucp")) {
- debug_printf(" %s %s", argv[n], argv[n+1]);
- key.ucp_enables = strtol(argv[n+1], NULL, 0);
- n += 2;
- continue;
- }
-
- if (!strcmp(argv[n], "--gpu")) {
- debug_printf(" %s %s", argv[n], argv[n+1]);
- gpu_id = strtol(argv[n+1], NULL, 0);
- n += 2;
- continue;
- }
-
- if (!strcmp(argv[n], "--help")) {