From 6d021f50edabfe1ad8c566053c1470df76d99037 Mon Sep 17 00:00:00 2001 From: Alexey Lysenko Date: Sun, 30 Aug 2026 23:09:38 +0300 Subject: [PATCH] wrapper: prefer native BCn in automatic mode When automatic BCn selection reaches an otherwise unknown driver, use the base driver if it advertises textureCompressionBC and the native policy permits it. The policy defaults on for VK_DRIVER_ID_NVIDIA_PROPRIETARY and can be overridden with WRAPPER_NATIVE_BCN. Existing Qualcomm and Turnip selection, explicit emulation modes, and format-property handling remain unchanged. --- src/vulkan/wrapper/wrapper_physical_device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vulkan/wrapper/wrapper_physical_device.c b/src/vulkan/wrapper/wrapper_physical_device.c index d3f25b0c..efcd6d59 100644 --- a/src/vulkan/wrapper/wrapper_physical_device.c +++ b/src/vulkan/wrapper/wrapper_physical_device.c @@ -13,6 +13,7 @@ #include "vk_util.h" #include "wsi_common.h" #include "util/os_misc.h" +#include "util/u_debug.h" static uint32_t parse_vk_version_from_env() @@ -364,7 +365,15 @@ VkResult enumerate_physical_device(struct vk_instance *_instance) 0 : 1; } else if (pdevice->driver_properties.driverID == VK_DRIVER_ID_MESA_TURNIP) { wrapper_emulate_bcn = 0; + } else if (pdevice->base_supported_features.textureCompressionBC && + debug_get_bool_option("WRAPPER_NATIVE_BCN", + pdevice->driver_properties.driverID == + VK_DRIVER_ID_NVIDIA_PROPRIETARY)) { + wrapper_emulate_bcn = 0; } + + if (wrapper_emulate_bcn == 0) + WRAPPER_LOG(info, "Using native BCn support in automatic mode"); } pdevice->emulate_bcn = wrapper_emulate_bcn;