diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-02-27 10:58:25 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-02-27 10:58:25 -0500 |
commit | 6ac4d31eb4ac67fcc6cf6c9e04419b60d2c7d80c (patch) | |
tree | c4efd7c5056170f18c7af1777c0225cfc4977248 /convert_shader.c | |
parent | 7c590d40a92a8c30c55abb8406f779238b6cc49a (diff) |
convert_shader: add --r7xx option
Specify the native type of the shader being decoded
Diffstat (limited to 'convert_shader.c')
-rw-r--r-- | convert_shader.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/convert_shader.c b/convert_shader.c index e2930d0..4ccaebe 100644 --- a/convert_shader.c +++ b/convert_shader.c @@ -1305,27 +1305,34 @@ static int do_cf_inst(uint32_t *inst, uint32_t offset, int is_r700) int main (int argc, char* argv[]) { uint32_t sp[MAXINST]; FILE *fp; - int is_r700 = 1; //1 + int is_r700 = 0; uint32_t dword0 = sp[0]; uint32_t dword1 = sp[1]; uint32_t offset = 0; - int eop = 0, i = 0; + int eop = 0, i = 0, j = 0; memset(sp, 0, MAXINST*sizeof(uint32_t)); - if (argv[1]) { - fp = fopen(argv[1], "r"); - if (fp == NULL) { + if (argc > 1) { + for (i = 1; i < argc; i++) { + if (!strcmp("--r7xx", argv[i])) { + is_r700 = 1; + continue; + } else { + fp = fopen(argv[i], "r"); + if (fp == NULL) { printf("convert_shader: input file open error\n"); return -1; - } else { - for (i = 0; i < MAXINST; i++) { - fscanf(fp, "%x,", &sp[i]); + } else { + for (j = 0; j < MAXINST; j++) { + fscanf(fp, "%x,", &sp[j]); } + } + fclose(fp); } - fclose(fp); + } } else { - printf("convert_shader: no input shader file\n"); + printf("convert_shader [--r7xx] shader_file\n"); return -1; } |