iris: shader debug log
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 19 Jan 2018 23:41:46 +0000 (15:41 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:05 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_screen.c

index d1b4d443363e41989def7a03c28fc0df673df403..432f5741239dcf11bba3f84630d60d5fe4a00918 100644 (file)
@@ -464,6 +464,23 @@ iris_getparam_integer(struct iris_screen *screen, int param)
    return -1;
 }
 
+static void
+iris_shader_debug_log(void *data, const char *fmt, ...)
+{
+   // XXX: is data ice?
+   struct iris_context *ice = data;
+   struct pipe_debug_callback *dbg = &ice->dbg;
+   unsigned msg_id = 0;
+   va_list args;
+
+   if (!dbg->debug_message)
+      return;
+
+   va_start(args, fmt);
+   dbg->debug_message(ice, &msg_id, PIPE_DEBUG_TYPE_SHADER_INFO, fmt, args);
+   va_end(args);
+}
+
 struct pipe_screen *
 iris_screen_create(int fd)
 {
@@ -485,6 +502,7 @@ iris_screen_create(int fd)
    isl_device_init(&screen->isl_dev, &screen->devinfo, hw_has_swizzling);
 
    screen->compiler = brw_compiler_create(screen, &screen->devinfo);
+   screen->compiler->shader_debug_log = iris_shader_debug_log;
 
    struct pipe_screen *pscreen = &screen->base;