| 36 | #endif |
| 37 | |
| 38 | void print_usage(const char* argv0) { |
| 39 | printf(R"(%s - Compare two SPIR-V files |
| 40 | |
| 41 | Usage: %s <src_filename> <dst_filename> |
| 42 | |
| 43 | The SPIR-V binary is read from <src_filename> and <dst_filename>. If either |
| 44 | file ends in .spvasm, the SPIR-V is read as text and disassembled. |
| 45 | |
| 46 | The contents of the SPIR-V modules are analyzed and a diff is produced showing a |
| 47 | logical transformation from src to dst, in src's id-space. |
| 48 | |
| 49 | -h, --help Print this help. |
| 50 | --version Display diff version information. |
| 51 | |
| 52 | --color Force color output. The default when printing to a terminal. |
| 53 | If both --color and --no-color is present, --no-color prevails. |
| 54 | --no-color Don't print in color. The default when output goes to |
| 55 | something other than a terminal (e.g. a pipe, or a shell |
| 56 | redirection). |
| 57 | If both --color and --no-color is present, --no-color prevails. |
| 58 | |
| 59 | --no-indent Don't indent instructions. |
| 60 | |
| 61 | --no-header Don't output the header as leading comments. |
| 62 | |
| 63 | --with-id-map Also output the mapping between src and dst outputs. |
| 64 | |
| 65 | --ignore-set-binding |
| 66 | Don't use set/binding decorations for variable matching. |
| 67 | --ignore-location |
| 68 | Don't use location decorations for variable matching. |
| 69 | )", |
| 70 | argv0, argv0); |
| 71 | } |
| 72 | |
| 73 | bool is_assembly(const char* path) { |
| 74 | const char* suffix = strrchr(path, '.'); |