[vulkan, mobile] Reworking per-mobile gpu configuration block

This commit is contained in:
CamilleLaVey 2026-02-01 23:12:21 -04:00
parent 26c4656473
commit 0d518e7303
1 changed files with 13 additions and 6 deletions

View File

@ -435,6 +435,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
const bool is_mvk = driver_id == VK_DRIVER_ID_MOLTENVK;
const bool is_qualcomm = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
const bool is_turnip = driver_id == VK_DRIVER_ID_MESA_TURNIP;
const bool is_arm = driver_id == VK_DRIVER_ID_ARM_PROPRIETARY;
if (!is_suitable)
LOG_WARNING(Render_Vulkan, "Unsuitable driver - continuing anyways");
@ -485,13 +486,20 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
CollectPhysicalMemoryInfo();
CollectToolingInfo();
if (is_qualcomm) {
if (is_qualcomm || is_arm) {
const char* driver_name = is_qualcomm ? "Qualcomm" : "ARM Mali";
must_emulate_scaled_formats = true;
LOG_WARNING(Render_Vulkan,
"Qualcomm drivers require scaled vertex format emulation; forcing fallback");
"{} drivers require scaled vertex format emulation; forcing fallback", driver_name);
if (is_qualcomm || is_arm) {
sets_per_pool = 1024;
LOG_INFO(Render_Vulkan, "{}: forcing {} sets per pool", driver_name, sets_per_pool);
}
LOG_WARNING(Render_Vulkan,
"Disabling shader float controls and 64-bit integer features on Qualcomm proprietary drivers");
"Disabling shader float controls and 64-bit integer features on {} proprietary drivers", driver_name);
RemoveExtension(extensions.shader_float_controls, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME);
RemoveExtensionFeature(extensions.shader_atomic_int64, features.shader_atomic_int64,
VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME);
@ -499,10 +507,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
features.shader_atomic_int64.shaderSharedInt64Atomics = false;
features.features.shaderInt64 = false;
sets_per_pool = 1024;
LOG_INFO(Render_Vulkan, "Qualcomm: forcing {} sets per pool", sets_per_pool);
#if defined(ANDROID) && defined(ARCHITECTURE_arm64)
if (is_qualcomm) {
// BCn patching only safe on Android 9+ (API 28+). Older versions crash on driver load.
const auto major = (properties.properties.driverVersion >> 24) << 2;
const auto minor = (properties.properties.driverVersion >> 12) & 0xFFFU;
@ -544,6 +550,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
api_level, major, minor);
}
#endif
}
}
if (is_nvidia) {