From 5165308169ffd7e29f30531f658858e80f6d9465 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 5 Jul 2018 02:53:54 -0700 Subject: [PATCH] iris: don't crash on shader perf logs --- src/gallium/drivers/iris/iris_screen.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 89cb52be4dc..98bbd680e8a 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -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; -- 2.30.2