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

Author: Karol Herbst <kher...@redhat.com>
Date:   Sun Aug  5 19:12:32 2018 +0200

nv50/ir: print color masks of tex instructions

v2: print the mask for TXG as well
    make the mask to be printed more mask like

Reviewed-by: Ilia Mirkin <imir...@alum.mit.edu>

---

 .../drivers/nouveau/codegen/nv50_ir_print.cpp      | 37 +++++++++++++++++++---
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
index 7eab8b8d70..7db9bf0caa 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
@@ -359,6 +359,31 @@ static const char *interpStr[16] =
    "samp sc"
 };
 
+static const char *texMaskStr[16] =
+{
+   "____",
+   "r___",
+   "_g__",
+   "rg__",
+   "__b_",
+   "r_b_",
+   "_gb_",
+   "rgb_",
+   "___a",
+   "r__a",
+   "_g_a",
+   "rg_a",
+   "__ba",
+   "r_ba",
+   "_gba",
+   "rgba",
+};
+
+static const char *gatherCompStr[4] =
+{
+   "r", "g", "b", "a",
+};
+
 #define PRINT(args...)                                \
    do {                                               \
       pos += snprintf(&buf[pos], size - pos, args);   \
@@ -651,10 +676,14 @@ void Instruction::print() const
       }
       if (perPatch)
          PRINT("patch ");
-      if (asTex())
-         PRINT("%s %s$r%u $s%u %s", asTex()->tex.target.getName(),
-               colour[TXT_MEM], asTex()->tex.r, asTex()->tex.s,
-               colour[TXT_INSN]);
+      if (asTex()) {
+         PRINT("%s %s$r%u $s%u ", asTex()->tex.target.getName(),
+               colour[TXT_MEM], asTex()->tex.r, asTex()->tex.s);
+         if (op == OP_TXG)
+            PRINT("%s ", gatherCompStr[asTex()->tex.gatherComp]);
+         PRINT("%s %s", texMaskStr[asTex()->tex.mask], colour[TXT_INSN]);
+      }
+
       if (postFactor)
          PRINT("x2^%i ", postFactor);
       PRINT("%s%s", dnz ? "dnz " : (ftz ? "ftz " : ""),  DataTypeStr[dType]);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to