From: Mike Blumenkrantz Date: Wed, 8 Mar 2023 17:20:27 +0000 (-0500) Subject: zink: ignore renderdoc if ZINK_RENDERDOC isn't in use X-Git-Tag: upstream/23.3.3~11786 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c04a7c926724e338037518926722cd10bcf7ff2f;p=platform%2Fupstream%2Fmesa.git zink: ignore renderdoc if ZINK_RENDERDOC isn't in use this otherwise has some weird side effects Fixes: 48a0478126f ("zink: add renderdoc handling") Part-of: --- diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index e3b994f..043d822 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -2022,6 +2022,9 @@ static void setup_renderdoc(struct zink_screen *screen) { #ifdef HAVE_RENDERDOC_APP_H + const char *capture_id = debug_get_option("ZINK_RENDERDOC", NULL); + if (!capture_id) + return; void *renderdoc = dlopen("librenderdoc.so", RTLD_NOW | RTLD_NOLOAD); /* not loaded */ if (!renderdoc) @@ -2036,9 +2039,6 @@ setup_renderdoc(struct zink_screen *screen) get_api(eRENDERDOC_API_Version_1_0_0, (void*)&screen->renderdoc_api); screen->renderdoc_api->SetActiveWindow(RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(screen->instance), NULL); - const char *capture_id = debug_get_option("ZINK_RENDERDOC", NULL); - if (!capture_id) - return; int count = sscanf(capture_id, "%u:%u", &screen->renderdoc_capture_start, &screen->renderdoc_capture_end); if (count != 2) { count = sscanf(capture_id, "%u", &screen->renderdoc_capture_start);