From e32c36df079676811f9c02058d6ae384633b5fa1 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 27 Feb 2024 12:33:33 -0600 Subject: [PATCH] nvk: Don't print the NVK_I_WANT_A_BROKEN_VULKAN_DRIVER warning in release builds The environment variable is still there and it still works but this means that release builds will simply silently fail to enumerate rather than throwing confusing warnings at users. Reviewed-by: Joshua Ashton Part-of: --- src/nouveau/vulkan/nvk_physical_device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 7eb5ab3402e..14b2961f3d8 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -1048,11 +1048,15 @@ nvk_create_drm_physical_device(struct vk_instance *_instance, if (!conformant && !debug_get_bool_option("NVK_I_WANT_A_BROKEN_VULKAN_DRIVER", false)) { +#ifdef NDEBUG + result = VK_ERROR_INCOMPATIBLE_DRIVER; +#else result = vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER, "WARNING: NVK is not well-tested on %s, pass " "NVK_I_WANT_A_BROKEN_VULKAN_DRIVER=1 " "if you know what you're doing.", info.device_name); +#endif goto fail_ws_dev; }