diff --git a/src/common/android/id_cache.cpp b/src/common/android/id_cache.cpp index 1198833996..96e458a9f1 100644 --- a/src/common/android/id_cache.cpp +++ b/src/common/android/id_cache.cpp @@ -10,6 +10,8 @@ #include "video_core/rasterizer_interface.h" #include "common/android/multiplayer/multiplayer.h" #include +#include "common/settings.h" +#include "common/logging/log.h" static JavaVM *s_java_vm; @@ -524,6 +526,13 @@ namespace Common::Android { s_patch_title_id_field = env->GetFieldID(patch_class, "titleId", "Ljava/lang/String;"); env->DeleteLocalRef(patch_class); + // Prefer hardware decoding on Android by default, forcing this setting will + // make the native side attempt GPU decoding first. If the platform lacks a usable + // FFmpeg HW device, FFmpeg will fall back to CPU automatically. + Settings::values.nvdec_emulation.SetValue(Settings::NvdecEmulation::Gpu); + LOG_INFO(HW_GPU, "Android JNI_OnLoad: forced nvdec_emulation = GPU"); + + const jclass double_class = env->FindClass("java/lang/Double"); s_double_class = reinterpret_cast(env->NewGlobalRef(double_class)); s_double_constructor = env->GetMethodID(double_class, "", "(D)V"); diff --git a/src/common/settings.h b/src/common/settings.h index 0b61da88f9..718c7d4e42 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -349,7 +349,9 @@ struct Values { linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer}; SwitchableSetting accelerate_astc{linkage, #ifdef ANDROID - AstcDecodeMode::Cpu, + // Most modern Android devices have native ASTC support + // and benefit from GPU decoding. Default to GPU there. + AstcDecodeMode::Gpu, #else AstcDecodeMode::Gpu, #endif