Mesa (master): r300: Moar vs debug.
Corbin Simpson
csimpson at kemper.freedesktop.org
Fri Jun 5 06:28:00 UTC 2009
Module: Mesa
Branch: master
Commit: fb7d1fb0f0ce4137b6cb84198997241d190d13a8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fb7d1fb0f0ce4137b6cb84198997241d190d13a8
Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date: Thu Jun 4 21:38:33 2009 -0700
r300: Moar vs debug.
---
src/gallium/drivers/r300/r300_debug.c | 19 ++++++++++++++++---
src/gallium/drivers/r300/r300_debug.h | 12 ++++++++++++
2 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index ffc93eb..32fa739 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -165,14 +165,27 @@ static void r300_vs_op_dump(uint32_t op)
}
}
+void r300_vs_src_dump(uint32_t src)
+{
+ debug_printf(" %s/%s/%s/%s\n",
+ r300_vs_swiz_debug[(src >> 13) & 0x7],
+ r300_vs_swiz_debug[(src >> 16) & 0x7],
+ r300_vs_swiz_debug[(src >> 19) & 0x7],
+ r300_vs_swiz_debug[(src >> 22) & 0x7]);
+}
+
void r300_vs_dump(struct r300_vertex_shader* vs)
{
int i;
for (i = 0; i < vs->instruction_count; i++) {
+ debug_printf("%d: op: 0x%08x", i, vs->instructions[i].inst0);
r300_vs_op_dump(vs->instructions[i].inst0);
- debug_printf("inst1: 0x%x\n", vs->instructions[i].inst1);
- debug_printf("inst2: 0x%x\n", vs->instructions[i].inst2);
- debug_printf("inst3: 0x%x\n", vs->instructions[i].inst3);
+ debug_printf(" src0: 0x%08x", vs->instructions[i].inst1);
+ r300_vs_src_dump(vs->instructions[i].inst1);
+ debug_printf(" src1: 0x%08x", vs->instructions[i].inst2);
+ r300_vs_src_dump(vs->instructions[i].inst2);
+ debug_printf(" src2: 0x%08x", vs->instructions[i].inst3);
+ r300_vs_src_dump(vs->instructions[i].inst3);
}
}
diff --git a/src/gallium/drivers/r300/r300_debug.h b/src/gallium/drivers/r300/r300_debug.h
index 6306594..3939d83 100644
--- a/src/gallium/drivers/r300/r300_debug.h
+++ b/src/gallium/drivers/r300/r300_debug.h
@@ -173,6 +173,18 @@ static char* r300_vs_me_ops[] = {
" (reserved)",
};
+/* XXX refactor to avoid clashing symbols */
+static char* r300_vs_swiz_debug[] = {
+ "X",
+ "Y",
+ "Z",
+ "W",
+ "0",
+ "1",
+ "U",
+ "U",
+};
+
void r500_fs_dump(struct r500_fragment_shader* fs);
void r300_vs_dump(struct r300_vertex_shader* vs);
More information about the mesa-commit
mailing list