From 6c03a85094005552b86bdd76bff8e8c48e65bb89 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 26 May 2021 14:30:27 +0200 Subject: [PATCH] zink: untangle have_EXT_debug_utils and ZINK_DEBUG_VALIDATION EXT_debug_utils is useful for more than just validation, so let's untangle these a bit. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_instance.py | 9 ++------- src/gallium/drivers/zink/zink_screen.c | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/zink/zink_instance.py b/src/gallium/drivers/zink/zink_instance.py index bc0313b7c3e..b3c2451df27 100644 --- a/src/gallium/drivers/zink/zink_instance.py +++ b/src/gallium/drivers/zink/zink_instance.py @@ -55,9 +55,9 @@ EXTENSIONS = [ LAYERS = [ # if we have debug_util, allow a validation layer to be added. Layer("VK_LAYER_KHRONOS_validation", - conditions=["have_EXT_debug_utils"]), + conditions=["zink_debug & ZINK_DEBUG_VALIDATION"]), Layer("VK_LAYER_LUNARG_standard_validation", - conditions=["have_EXT_debug_utils", "!have_layer_KHRONOS_validation"]), + conditions=["zink_debug & ZINK_DEBUG_VALIDATION", "!have_layer_KHRONOS_validation"]), ] REPLACEMENTS = { @@ -146,11 +146,6 @@ zink_create_instance(struct zink_instance_info *instance_info) } } - // Clear have_EXT_debug_utils if we do not want debug info - if (!(zink_debug & ZINK_DEBUG_VALIDATION)) { - have_EXT_debug_utils = false; - } - // Build up the layers from the reported ones uint32_t layer_count = 0; diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index d0f855f218d..ab1c4e590b0 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -1612,7 +1612,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config) if (!screen->instance) goto fail; - if (screen->instance_info.have_EXT_debug_utils && !create_debug(screen)) + if (screen->instance_info.have_EXT_debug_utils && + (zink_debug & ZINK_DEBUG_VALIDATION) && !create_debug(screen)) debug_printf("ZINK: failed to setup debug utils\n"); choose_pdev(screen);