diff options
author | bunnei <bunneidev@gmail.com> | 2023-04-12 07:03:19 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:50 +0200 |
commit | 4006468f7368d0afe51be11a466e5b33c62e362d (patch) | |
tree | ca0294e6f596aa09a05352ad56687a41de60a764 /src/android/app/src/main/jni/native.cpp | |
parent | android: vulkan_debug_callback: Ignore many innocuous errors. (diff) | |
download | yuzu-4006468f7368d0afe51be11a466e5b33c62e362d.tar yuzu-4006468f7368d0afe51be11a466e5b33c62e362d.tar.gz yuzu-4006468f7368d0afe51be11a466e5b33c62e362d.tar.bz2 yuzu-4006468f7368d0afe51be11a466e5b33c62e362d.tar.lz yuzu-4006468f7368d0afe51be11a466e5b33c62e362d.tar.xz yuzu-4006468f7368d0afe51be11a466e5b33c62e362d.tar.zst yuzu-4006468f7368d0afe51be11a466e5b33c62e362d.zip |
Diffstat (limited to 'src/android/app/src/main/jni/native.cpp')
-rw-r--r-- | src/android/app/src/main/jni/native.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 55736bce2..b10c55a45 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -51,6 +51,7 @@ #include "jni/emu_window/emu_window.h" #include "jni/id_cache.h" #include "video_core/rasterizer_interface.h" +#include "video_core/renderer_base.h" namespace { @@ -229,6 +230,15 @@ public: m_is_running = true; } + // Load the disk shader cache. + if (Settings::values.use_disk_shader_cache.GetValue()) { + LoadDiskCacheProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0); + m_system.Renderer().ReadRasterizer()->LoadDiskResources( + m_system.GetApplicationProcessProgramID(), std::stop_token{}, + LoadDiskCacheProgress); + LoadDiskCacheProgress(VideoCore::LoadCallbackStage::Complete, 0, 0); + } + void(m_system.Run()); if (m_system.DebuggerEnabled()) { @@ -296,6 +306,14 @@ private: } private: + static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max) { + JNIEnv* env = IDCache::GetEnvForThread(); + env->CallStaticVoidMethod(IDCache::GetDiskCacheProgressClass(), + IDCache::GetDiskCacheLoadProgress(), static_cast<jint>(stage), + static_cast<jint>(progress), static_cast<jint>(max)); + } + +private: static EmulationSession s_instance; // Frontend management |