iris: don't crash on shader perf logs
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 5 Jul 2018 09:53:54 +0000 (02:53 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:07 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_screen.c

index 89cb52be4dce650768838f98ff66ff912df6fbbf..98bbd680e8ab8ebbc0ebf6f2304e64f2aeea7245 100644 (file)
@@ -497,11 +497,25 @@ iris_shader_debug_log(void *data, const char *fmt, ...)
       return;
 
    va_start(args, fmt);
-
    dbg->debug_message(dbg->data, &id, PIPE_DEBUG_TYPE_SHADER_INFO, fmt, args);
    va_end(args);
 }
 
+static void
+iris_shader_perf_log(void *data, const char *fmt, ...)
+{
+   struct pipe_debug_callback *dbg = data;
+   unsigned id = 0;
+   va_list args;
+
+   if (!dbg->debug_message)
+      return;
+
+   va_start(args, fmt);
+   dbg->debug_message(dbg->data, &id, PIPE_DEBUG_TYPE_PERF_INFO, fmt, args);
+   va_end(args);
+}
+
 struct pipe_screen *
 iris_screen_create(int fd)
 {
@@ -531,6 +545,7 @@ iris_screen_create(int fd)
 
    screen->compiler = brw_compiler_create(screen, &screen->devinfo);
    screen->compiler->shader_debug_log = iris_shader_debug_log;
+   screen->compiler->shader_perf_log = iris_shader_perf_log;
 
    struct pipe_screen *pscreen = &screen->base;