diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-09-05 19:06:17 +0200 |
---|---|---|
committer | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-09-09 19:21:34 +0200 |
commit | 217542a061ef31150b1b04f1b45b6099bcc153fe (patch) | |
tree | f572d10138a5631cae29420a3d22a7b3a5f9011d /src/gallium | |
parent | 9e4901402cf50405be28ce6311f10e22196fbc35 (diff) |
nv50: save tgsi instructions
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 523603ca3af..d7d3030e2f6 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -499,6 +499,8 @@ nv50_prog_scan(struct nv50_translation_info *ti) ti->immd32 = (uint32_t *)MALLOC(ti->scan.immediate_count * 16); ti->immd32_ty = (ubyte *)MALLOC(ti->scan.immediate_count * sizeof(ubyte)); + ti->insns = MALLOC(ti->scan.num_instructions * sizeof(ti->insns[0])); + tgsi_parse_init(&parse, p->pipe.tokens); while (!tgsi_parse_end_of_tokens(&parse)) { tgsi_parse_token(&parse); @@ -511,6 +513,7 @@ nv50_prog_scan(struct nv50_translation_info *ti) prog_decl(ti, &parse.FullToken.FullDeclaration); break; case TGSI_TOKEN_TYPE_INSTRUCTION: + ti->insns[ti->inst_nr] = parse.FullToken.FullInstruction; prog_inst(ti, &parse.FullToken.FullInstruction, ++ti->inst_nr); break; } @@ -567,6 +570,8 @@ out: FREE(ti->immd32); if (ti->immd32_ty) FREE(ti->immd32_ty); + if (ti->insns) + FREE(ti->insns); FREE(ti); return ret ? FALSE : TRUE; } diff --git a/src/gallium/drivers/nv50/nv50_program.h b/src/gallium/drivers/nv50/nv50_program.h index 639f06217ed..3c3f1f7f970 100644 --- a/src/gallium/drivers/nv50/nv50_program.h +++ b/src/gallium/drivers/nv50/nv50_program.h @@ -104,6 +104,7 @@ struct nv50_subroutine { struct nv50_translation_info { struct nv50_program *p; unsigned inst_nr; + struct tgsi_full_instruction *insns; ubyte input_file; ubyte output_file; ubyte input_map[PIPE_MAX_SHADER_INPUTS][4]; |