Mesa (nv50-compiler): nv50: save tgsi instructions

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Thu Sep 9 17:21:34 UTC 2010


Module: Mesa
Branch: nv50-compiler
Commit: 217542a061ef31150b1b04f1b45b6099bcc153fe
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=217542a061ef31150b1b04f1b45b6099bcc153fe

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sun Sep  5 19:06:17 2010 +0200

nv50: save tgsi instructions

---

 src/gallium/drivers/nv50/nv50_program.c |    5 +++++
 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 523603c..d7d3030 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 639f062..3c3f1f7 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];




More information about the mesa-commit mailing list