freedreno: Get shader variant msgs in perf debug output
authorRob Clark <robdclark@chromium.org>
Sat, 2 Oct 2021 18:55:10 +0000 (11:55 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 4 Oct 2021 15:10:07 +0000 (15:10 +0000)
We want FD_MESA_DEBUG=perf to also tell us about variants.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>

src/gallium/drivers/freedreno/freedreno_util.h
src/gallium/drivers/freedreno/ir3/ir3_gallium.c

index c989262..5e00657 100644 (file)
@@ -114,13 +114,19 @@ extern bool fd_binning_enabled;
                    ##__VA_ARGS__);                                             \
    } while (0)
 
-#define perf_debug_ctx(ctx, ...)                                               \
+#define perf_debug_message(debug, type, ...)                                   \
    do {                                                                        \
       if (FD_DBG(PERF))                                                        \
          mesa_logw(__VA_ARGS__);                                               \
+      struct pipe_debug_callback *__d = (debug);                               \
+      if (__d)                                                                 \
+         pipe_debug_message(__d, type, __VA_ARGS__);                           \
+   } while (0)
+
+#define perf_debug_ctx(ctx, ...)                                               \
+   do {                                                                        \
       struct fd_context *__c = (ctx);                                          \
-      if (__c)                                                                 \
-         pipe_debug_message(&__c->debug, PERF_INFO, __VA_ARGS__);              \
+      perf_debug_message(__c ? &__c->debug : NULL, PERF_INFO, __VA_ARGS__);    \
    } while (0)
 
 #define perf_debug(...) perf_debug_ctx(NULL, __VA_ARGS__)
index 947bef3..701fc47 100644 (file)
@@ -133,7 +133,7 @@ ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key,
 
    if (created) {
       if (shader->initial_variants_done) {
-         pipe_debug_message(debug, SHADER_INFO,
+         perf_debug_message(debug, SHADER_INFO,
                             "%s shader: recompiling at draw time: global "
                             "0x%08x, vfsamples %x/%x, astc %x/%x\n",
                             ir3_shader_stage(v), key.global, key.vsamples,