Compare commits
3 Commits
3096/hle/b
...
android/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efe054a6a5 | ||
|
|
25459ad09b | ||
|
|
1db8446a51 |
@@ -28,6 +28,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||
SYNC_MEMORY_OPERATIONS("sync_memory_operations"),
|
||||
BUFFER_REORDER_DISABLE("disable_buffer_reorder"),
|
||||
RENDERER_DEBUG("debug"),
|
||||
RENDERER_PATCH_OLD_QCOM_DRIVERS("patch_old_qcom_drivers"),
|
||||
RENDERER_VERTEX_INPUT_DYNAMIC_STATE("vertex_input_dynamic_state"),
|
||||
RENDERER_PROVOKING_VERTEX("provoking_vertex"),
|
||||
RENDERER_DESCRIPTOR_INDEXING("descriptor_indexing"),
|
||||
|
||||
@@ -766,6 +766,13 @@ abstract class SettingsItem(
|
||||
descriptionId = R.string.renderer_debug_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RENDERER_PATCH_OLD_QCOM_DRIVERS,
|
||||
titleId = R.string.patch_old_qcom_drivers,
|
||||
descriptionId = R.string.patch_old_qcom_drivers_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.USE_AUTO_STUB,
|
||||
|
||||
@@ -1161,6 +1161,7 @@ class SettingsFragmentPresenter(
|
||||
add(HeaderSetting(R.string.gpu))
|
||||
add(IntSetting.RENDERER_BACKEND.key)
|
||||
add(BooleanSetting.RENDERER_DEBUG.key)
|
||||
add(BooleanSetting.RENDERER_PATCH_OLD_QCOM_DRIVERS.key)
|
||||
|
||||
add(HeaderSetting(R.string.cpu))
|
||||
add(IntSetting.CPU_BACKEND.key)
|
||||
|
||||
@@ -524,6 +524,8 @@
|
||||
<string name="renderer_api">API</string>
|
||||
<string name="renderer_debug">Graphics debugging</string>
|
||||
<string name="renderer_debug_description">Sets the graphics API to a slow debugging mode.</string>
|
||||
<string name="patch_old_qcom_drivers">Enable BCn Textures</string>
|
||||
<string name="patch_old_qcom_drivers_description">Enable patch support for BCn texture formats on Adreno Drivers when not support natively. (Disable to fix fetching drivers and random crashes on old Android versions)</string>
|
||||
<string name="fastmem">Fastmem</string>
|
||||
|
||||
<string name="log">Logging</string>
|
||||
|
||||
@@ -546,6 +546,9 @@ struct Values {
|
||||
true,
|
||||
false,
|
||||
&sample_shading};
|
||||
#ifdef ANDROID
|
||||
SwitchableSetting<bool> patch_old_qcom_drivers{linkage, true, "patch_old_qcom_drivers", Category::RendererDebug};
|
||||
#endif
|
||||
|
||||
Setting<bool> renderer_debug{linkage, false, "debug", Category::RendererDebug};
|
||||
Setting<bool> renderer_shader_feedback{linkage, false, "shader_feedback",
|
||||
|
||||
@@ -503,12 +503,13 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||
|
||||
#if defined(ANDROID) && defined(ARCHITECTURE_arm64)
|
||||
// Patch the driver to enable BCn textures.
|
||||
const bool patch_old_qcom_drivers = Settings::values.patch_old_qcom_drivers.GetValue();
|
||||
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);
|
||||
|
||||
if (patch_status == ADRENOTOOLS_BCN_PATCH) {
|
||||
if (patch_status == ADRENOTOOLS_BCN_PATCH && patch_old_qcom_drivers) {
|
||||
LOG_INFO(Render_Vulkan, "Patching Adreno driver to support BCn texture formats");
|
||||
if (adrenotools_patch_bcn(
|
||||
reinterpret_cast<void*>(dld.vkGetPhysicalDeviceFormatProperties))) {
|
||||
@@ -519,7 +520,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||
} else if (patch_status == ADRENOTOOLS_BCN_BLOB) {
|
||||
LOG_INFO(Render_Vulkan, "Adreno driver supports BCn textures without patches");
|
||||
} else {
|
||||
LOG_WARNING(Render_Vulkan, "Adreno driver can't be patched to enable BCn textures");
|
||||
LOG_WARNING(Render_Vulkan, "Adreno driver not patched to enable BCn textures");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user