diff --git a/src/microsoft/spirv_to_dxil/spirv2dxil.c b/src/microsoft/spirv_to_dxil/spirv2dxil.c index ded6bcbf406..e590034be95 100644 --- a/src/microsoft/spirv_to_dxil/spirv2dxil.c +++ b/src/microsoft/spirv_to_dxil/spirv2dxil.c @@ -69,17 +69,18 @@ main(int argc, char **argv) char *entry_point = "main"; char *output_file = ""; int ch; - bool validate = false; + bool validate = false, debug = false; static struct option long_options[] = { {"stage", required_argument, 0, 's'}, {"entry", required_argument, 0, 'e'}, {"output", required_argument, 0, 'o'}, {"validate", no_argument, 0, 'v'}, + {"debug", no_argument, 0, 'd'}, {0, 0, 0, 0}}; - while ((ch = getopt_long(argc, argv, "s:e:o:v", long_options, NULL)) != + while ((ch = getopt_long(argc, argv, "s:e:o:vd", long_options, NULL)) != -1) { switch(ch) { @@ -99,6 +100,9 @@ main(int argc, char **argv) case 'v': validate = true; break; + case 'd': + debug = true; + break; default: fprintf(stderr, "Unrecognized option.\n"); return 1; @@ -136,7 +140,7 @@ main(int argc, char **argv) conf.zero_based_vertex_instance_id = true; struct dxil_spirv_debug_options dbg_opts = { - .dump_nir = false, + .dump_nir = debug, }; struct dxil_spirv_object obj;