diff options
| author | 2023-01-03 04:18:45 +0100 | |
|---|---|---|
| committer | 2023-01-05 21:03:01 +0100 | |
| commit | 9c9008ac813161bfbb6489ee128199e27c9515f7 (patch) | |
| tree | d9acfe3e14bc5bb16326c1f36bd4dd715a57a43a | |
| parent | config: Set the Vulkan driver pipeline cache option to be global (diff) | |
| download | yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar.gz yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar.xz yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.zip | |
video_core/vulkan: Driver pipeline cache will now be deleted with the shader cache
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/main.cpp | 20 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 524650144..c55f81c2f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -2229,8 +2229,10 @@ void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget targ | |||
| 2229 | } | 2229 | } |
| 2230 | 2230 | ||
| 2231 | switch (target) { | 2231 | switch (target) { |
| 2232 | case GameListRemoveTarget::GlShaderCache: | ||
| 2233 | case GameListRemoveTarget::VkShaderCache: | 2232 | case GameListRemoveTarget::VkShaderCache: |
| 2233 | RemoveVulkanDriverPipelineCache(program_id); | ||
| 2234 | [[fallthrough]]; | ||
| 2235 | case GameListRemoveTarget::GlShaderCache: | ||
| 2234 | RemoveTransferableShaderCache(program_id, target); | 2236 | RemoveTransferableShaderCache(program_id, target); |
| 2235 | break; | 2237 | break; |
| 2236 | case GameListRemoveTarget::AllShaderCache: | 2238 | case GameListRemoveTarget::AllShaderCache: |
| @@ -2271,6 +2273,22 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id, GameListRemoveTa | |||
| 2271 | } | 2273 | } |
| 2272 | } | 2274 | } |
| 2273 | 2275 | ||
| 2276 | void GMainWindow::RemoveVulkanDriverPipelineCache(u64 program_id) { | ||
| 2277 | static constexpr std::string_view target_file_name = "vulkan_pipelines.bin"; | ||
| 2278 | |||
| 2279 | const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir); | ||
| 2280 | const auto shader_cache_folder_path = shader_cache_dir / fmt::format("{:016x}", program_id); | ||
| 2281 | const auto target_file = shader_cache_folder_path / target_file_name; | ||
| 2282 | |||
| 2283 | if (!Common::FS::Exists(target_file)) { | ||
| 2284 | return; | ||
| 2285 | } | ||
| 2286 | if (!Common::FS::RemoveFile(target_file)) { | ||
| 2287 | QMessageBox::warning(this, tr("Error Removing Vulkan Driver Pipeline Cache"), | ||
| 2288 | tr("Failed to remove the driver pipeline cache.")); | ||
| 2289 | } | ||
| 2290 | } | ||
| 2291 | |||
| 2274 | void GMainWindow::RemoveAllTransferableShaderCaches(u64 program_id) { | 2292 | void GMainWindow::RemoveAllTransferableShaderCaches(u64 program_id) { |
| 2275 | const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir); | 2293 | const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir); |
| 2276 | const auto program_shader_cache_dir = shader_cache_dir / fmt::format("{:016x}", program_id); | 2294 | const auto program_shader_cache_dir = shader_cache_dir / fmt::format("{:016x}", program_id); |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index db318485d..f25ce65a8 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -347,6 +347,7 @@ private: | |||
| 347 | void RemoveUpdateContent(u64 program_id, InstalledEntryType type); | 347 | void RemoveUpdateContent(u64 program_id, InstalledEntryType type); |
| 348 | void RemoveAddOnContent(u64 program_id, InstalledEntryType type); | 348 | void RemoveAddOnContent(u64 program_id, InstalledEntryType type); |
| 349 | void RemoveTransferableShaderCache(u64 program_id, GameListRemoveTarget target); | 349 | void RemoveTransferableShaderCache(u64 program_id, GameListRemoveTarget target); |
| 350 | void RemoveVulkanDriverPipelineCache(u64 program_id); | ||
| 350 | void RemoveAllTransferableShaderCaches(u64 program_id); | 351 | void RemoveAllTransferableShaderCaches(u64 program_id); |
| 351 | void RemoveCustomConfiguration(u64 program_id, const std::string& game_path); | 352 | void RemoveCustomConfiguration(u64 program_id, const std::string& game_path); |
| 352 | std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id); | 353 | std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id); |