[Mesa-dev] [PATCH] i965: Disable hex offset printing in disassembly.

Kenneth Graunke kenneth at whitecape.org
Thu Jul 17 16:34:43 PDT 2014


Printing the hex offsets makes it basically impossible to diff assembly:
if you add even a single instruction, the entire shader shows up as a
difference.  So, every time I want to compare assembly, I have to strip
this out.

The hex offsets might be useful when debugging compaction, or when
inspecting the program cache buffer.  Since it's occasionally useful,
but uncommon, this patch disables it by default, but makes it easy to
re-enable it temporarily when the need arises.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Matt Turner <mattst88 at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_eu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index f4c7495..a400b44 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -241,7 +241,8 @@ brw_disassemble(struct brw_context *brw,
       brw_inst *insn = assembly + offset;
       brw_inst uncompacted;
       bool compacted = brw_inst_cmpt_control(brw, insn);
-      fprintf(out, "0x%08x: ", offset);
+      if (0)
+         fprintf(out, "0x%08x: ", offset);
 
       if (compacted) {
          brw_compact_inst *compacted = (void *)insn;
-- 
2.0.1



More information about the mesa-dev mailing list