summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_program.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-09-05 19:06:17 +0200
committerChristoph Bumiller <[email protected]>2010-09-09 19:21:34 +0200
commit217542a061ef31150b1b04f1b45b6099bcc153fe (patch)
treef572d10138a5631cae29420a3d22a7b3a5f9011d /src/gallium/drivers/nv50/nv50_program.c
parent9e4901402cf50405be28ce6311f10e22196fbc35 (diff)
nv50: save tgsi instructions
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_program.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c5
1 files changed, 5 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;
}