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 <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27832>
This commit is contained in:
Faith Ekstrand
2024-02-27 12:33:33 -06:00
committed by Marge Bot
parent b5dab7c965
commit e32c36df07
+4
View File
@@ -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;
}