iris: Make shader_perf_log print to stderr if INTEL_DEBUG=perf is set
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 16 Apr 2019 05:34:15 +0000 (22:34 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 16 Apr 2019 06:33:03 +0000 (23:33 -0700)
This matches i965's behavior, and makes sure that shader compiler
messages are visible when setting INTEL_DEBUG=perf.

src/gallium/drivers/iris/iris_screen.c

index 5333a2a303cfe30abe75811525519200a81d4360..023224367730b882894313fd13cb90e100b1b6fb 100644 (file)
@@ -532,12 +532,19 @@ iris_shader_perf_log(void *data, const char *fmt, ...)
    struct pipe_debug_callback *dbg = data;
    unsigned id = 0;
    va_list args;
+   va_start(args, fmt);
 
-   if (!dbg->debug_message)
-      return;
+   if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+      va_list args_copy;
+      va_copy(args_copy, args);
+      vfprintf(stderr, fmt, args_copy);
+      va_end(args_copy);
+   }
+
+   if (dbg->debug_message) {
+      dbg->debug_message(dbg->data, &id, PIPE_DEBUG_TYPE_PERF_INFO, fmt, args);
+   }
 
-   va_start(args, fmt);
-   dbg->debug_message(dbg->data, &id, PIPE_DEBUG_TYPE_PERF_INFO, fmt, args);
    va_end(args);
 }