Mesa (master): r600g: dump raw shader output for debugging

Jerome Glisse glisse at kemper.freedesktop.org
Fri Dec 3 16:37:22 UTC 2010


Module: Mesa
Branch: master
Commit: 833f3a488a7ba0fa59e25f1e518f6b4616270143
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=833f3a488a7ba0fa59e25f1e518f6b4616270143

Author: Jerome Glisse <jglisse at redhat.com>
Date:   Fri Dec  3 11:34:47 2010 -0500

r600g: dump raw shader output for debugging

Signed-off-by: Jerome Glisse <jglisse at redhat.com>

---

 src/gallium/drivers/r600/r600_asm.c    |   25 +++++++++++++++++++++++++
 src/gallium/drivers/r600/r600_asm.h    |    1 +
 src/gallium/drivers/r600/r600_shader.c |    1 +
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index edadedf..73daa00 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -947,3 +947,28 @@ void r600_bc_clear(struct r600_bc *bc)
 
 	LIST_INITHEAD(&cf->list);
 }
+
+void r600_bc_dump(struct r600_bc *bc)
+{
+	unsigned i;
+	char chip = '6';
+
+	switch (bc->chiprev) {
+	case 1:
+		chip = '7';
+		break;
+	case 2:
+		chip = 'E';
+		break;
+	case 0:
+	default:
+		chip = '6';
+		break;
+	}
+	fprintf(stderr, "bytecode %d dw -----------------------\n", bc->ndw);
+	fprintf(stderr, "     %c\n", chip);
+	for (i = 0; i < bc->ndw; i++) {
+		fprintf(stderr, "0x%08X\n", bc->bytecode[i]);
+	}
+	fprintf(stderr, "--------------------------------------\n");
+}
diff --git a/src/gallium/drivers/r600/r600_asm.h b/src/gallium/drivers/r600/r600_asm.h
index f2016af..1be5e4a 100644
--- a/src/gallium/drivers/r600/r600_asm.h
+++ b/src/gallium/drivers/r600/r600_asm.h
@@ -200,6 +200,7 @@ int r600_bc_add_output(struct r600_bc *bc, const struct r600_bc_output *output);
 int r600_bc_build(struct r600_bc *bc);
 int r600_bc_add_cfinst(struct r600_bc *bc, int inst);
 int r600_bc_add_alu_type(struct r600_bc *bc, const struct r600_bc_alu *alu, int type);
+void r600_bc_dump(struct r600_bc *bc);
 
 /* r700_asm.c */
 int r700_bc_alu_build(struct r600_bc *bc, struct r600_bc_alu *alu, unsigned id);
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 77b1809..b6d815f 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -351,6 +351,7 @@ int r600_pipe_shader_create(struct pipe_context *ctx, struct r600_pipe_shader *s
 			return r;
 		}
 	}
+//r600_bc_dump(&shader->shader.bc);
 //fprintf(stderr, "______________________________________________________________\n");
 	return 0;
 }




More information about the mesa-commit mailing list