The Mystic Gidoly

This commit is contained in:
CamilleLaVey 2026-02-02 00:03:02 -04:00
parent 202193708a
commit 13903d6e8c
1 changed files with 38 additions and 40 deletions

View File

@ -493,10 +493,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
LOG_WARNING(Render_Vulkan,
"{} 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);
}
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 {} proprietary drivers", driver_name);
@ -509,48 +507,48 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
#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;
const auto vendor = properties.properties.vendorID;
const auto patch_status = adrenotools_get_bcn_type(major, minor, vendor);
const int api_level = android_get_device_api_level();
// BCn patching only safe on Android 9+ (API 28+). Older versions crash on driver load.
const auto major = (properties.properties.driverVersion >> 22) << 2;
const auto minor = (properties.properties.driverVersion >> 12) & 0xFFFU;
const auto vendor = properties.properties.vendorID;
const auto patch_status = adrenotools_get_bcn_type(major, minor, vendor);
const int api_level = android_get_device_api_level();
bool should_patch_bcn = api_level >= 28;
const bool bcn_debug_override = Settings::values.patch_old_qcom_drivers.GetValue();
if (bcn_debug_override != should_patch_bcn) {
LOG_WARNING(Render_Vulkan,
"BCn patch debug override active: {} (auto-detected: {})",
bcn_debug_override, should_patch_bcn);
should_patch_bcn = bcn_debug_override;
}
if (patch_status == ADRENOTOOLS_BCN_PATCH) {
if (should_patch_bcn) {
LOG_INFO(Render_Vulkan,
"Patching Adreno driver to support BCn texture formats "
"(Android API {}, Driver {}.{})", api_level, major, minor);
if (adrenotools_patch_bcn(
reinterpret_cast<void*>(dld.vkGetPhysicalDeviceFormatProperties))) {
OverrideBcnFormats(format_properties);
} else {
LOG_ERROR(Render_Vulkan, "BCn patch failed! Driver code may now crash");
}
} else {
bool should_patch_bcn = api_level >= 28;
const bool bcn_debug_override = Settings::values.patch_old_qcom_drivers.GetValue();
if (bcn_debug_override != should_patch_bcn) {
LOG_WARNING(Render_Vulkan,
"BCn texture patching skipped for stability (Android API {} < 28). "
"Driver version {}.{} would support patching, but may crash on older Android.",
"BCn patch debug override active: {} (auto-detected: {})",
bcn_debug_override, should_patch_bcn);
should_patch_bcn = bcn_debug_override;
}
if (patch_status == ADRENOTOOLS_BCN_PATCH) {
if (should_patch_bcn) {
LOG_INFO(Render_Vulkan,
"Patching Adreno driver to support BCn texture formats "
"(Android API {}, Driver {}.{})", api_level, major, minor);
if (adrenotools_patch_bcn(
reinterpret_cast<void*>(dld.vkGetPhysicalDeviceFormatProperties))) {
OverrideBcnFormats(format_properties);
} else {
LOG_ERROR(Render_Vulkan, "BCn patch failed! Driver code may now crash");
}
} else {
LOG_WARNING(Render_Vulkan,
"BCn texture patching skipped for stability (Android API {} < 28). "
"Driver version {}.{} would support patching, but may crash on older Android.",
api_level, major, minor);
}
} else if (patch_status == ADRENOTOOLS_BCN_BLOB) {
LOG_INFO(Render_Vulkan, "Adreno driver supports BCn textures natively (no patch needed)");
} else {
LOG_INFO(Render_Vulkan,
"Adreno driver does not support BCn texture patching (Android API {}, Driver {}.{})",
api_level, major, minor);
}
} else if (patch_status == ADRENOTOOLS_BCN_BLOB) {
LOG_INFO(Render_Vulkan, "Adreno driver supports BCn textures natively (no patch needed)");
} else {
LOG_INFO(Render_Vulkan,
"Adreno driver does not support BCn texture patching (Android API {}, Driver {}.{})",
api_level, major, minor);
}
#endif
}
}
if (is_nvidia) {