[vk, vendor] Forcing BGR5 emulation path due to driver misbehavior.

This commit is contained in:
CamilleLaVey 2025-11-25 08:47:54 -04:00 committed by Caio Oliveira
parent 0e4cd4ecd9
commit 8ffdf69831
No known key found for this signature in database
GPG Key ID: AAAE6C7FD4186B0C
1 changed files with 6 additions and 27 deletions

View File

@ -611,34 +611,13 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
LOG_WARNING(Render_Vulkan, "Intel ANV driver does not support native BGR format"); LOG_WARNING(Render_Vulkan, "Intel ANV driver does not support native BGR format");
must_emulate_bgr565 = true; must_emulate_bgr565 = true;
} else if (is_qualcomm) { } else if (is_qualcomm) {
// Qualcomm driver version where VK_KHR_maintenance5 and A1B5G5R5 become reliable LOG_WARNING(Render_Vulkan,
constexpr uint32_t QUALCOMM_FIXED_DRIVER_VERSION = VK_MAKE_VERSION(512, 800, 1); "Qualcomm driver mishandles BGR5 formats even with VK_KHR_maintenance5, forcing emulation");
// Check if VK_KHR_maintenance5 is supported must_emulate_bgr565 = true;
if (extensions.maintenance5 && properties.properties.driverVersion >= QUALCOMM_FIXED_DRIVER_VERSION) {
LOG_INFO(Render_Vulkan, "Qualcomm driver supports VK_KHR_maintenance5, disabling BGR emulation");
must_emulate_bgr565 = false;
} else {
LOG_WARNING(Render_Vulkan, "Qualcomm driver doesn't support native BGR, emulating formats");
must_emulate_bgr565 = true;
}
} else if (is_turnip) {
// Mesa Turnip added support for maintenance5 in Mesa 25.0
if (extensions.maintenance5) {
LOG_INFO(Render_Vulkan, "Turnip driver supports VK_KHR_maintenance5, disabling BGR emulation");
must_emulate_bgr565 = false;
} else {
LOG_WARNING(Render_Vulkan, "Turnip driver doesn't support native BGR, emulating formats");
must_emulate_bgr565 = true;
}
} else if (is_arm) { } else if (is_arm) {
// ARM Mali: stop emulating BGR5 formats when VK_KHR_maintenance5 is available LOG_WARNING(Render_Vulkan,
if (extensions.maintenance5) { "ARM Mali driver mishandles BGR5 formats even with VK_KHR_maintenance5, forcing emulation");
LOG_INFO(Render_Vulkan, "ARM driver supports VK_KHR_maintenance5, disabling BGR emulation"); must_emulate_bgr565 = true;
must_emulate_bgr565 = false;
} else {
LOG_WARNING(Render_Vulkan, "ARM driver doesn't support native BGR, emulating formats");
must_emulate_bgr565 = true;
}
} }
if (is_mvk) { if (is_mvk) {