diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 17 |
2 files changed, 12 insertions, 18 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index da0b36368..9391a4cd9 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -238,16 +238,13 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading, | |||
| 238 | if (title_id == 0) { | 238 | if (title_id == 0) { |
| 239 | return; | 239 | return; |
| 240 | } | 240 | } |
| 241 | auto shader_dir{Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir)}; | 241 | const auto shader_dir{Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir)}; |
| 242 | auto base_dir{shader_dir / "new_opengl"}; | 242 | const auto base_dir{shader_dir / fmt::format("{:016x}", title_id)}; |
| 243 | auto transferable_dir{base_dir / "transferable"}; | 243 | if (!Common::FS::CreateDir(shader_dir) || !Common::FS::CreateDir(base_dir)) { |
| 244 | auto precompiled_dir{base_dir / "precompiled"}; | 244 | LOG_ERROR(Common_Filesystem, "Failed to create shader cache directories"); |
| 245 | if (!Common::FS::CreateDir(shader_dir) || !Common::FS::CreateDir(base_dir) || | ||
| 246 | !Common::FS::CreateDir(transferable_dir) || !Common::FS::CreateDir(precompiled_dir)) { | ||
| 247 | LOG_ERROR(Common_Filesystem, "Failed to create pipeline cache directories"); | ||
| 248 | return; | 245 | return; |
| 249 | } | 246 | } |
| 250 | shader_cache_filename = transferable_dir / fmt::format("{:016x}.bin", title_id); | 247 | shader_cache_filename = base_dir / "opengl.bin"; |
| 251 | 248 | ||
| 252 | if (!workers) { | 249 | if (!workers) { |
| 253 | workers = CreateWorkers(); | 250 | workers = CreateWorkers(); |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index e61d76490..6df4088a7 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -337,22 +337,19 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading | |||
| 337 | if (title_id == 0) { | 337 | if (title_id == 0) { |
| 338 | return; | 338 | return; |
| 339 | } | 339 | } |
| 340 | auto shader_dir{Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir)}; | 340 | const auto shader_dir{Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir)}; |
| 341 | auto base_dir{shader_dir / "vulkan"}; | 341 | const auto base_dir{shader_dir / fmt::format("{:016x}", title_id)}; |
| 342 | auto transferable_dir{base_dir / "transferable"}; | 342 | if (!Common::FS::CreateDir(shader_dir) || !Common::FS::CreateDir(base_dir)) { |
| 343 | auto precompiled_dir{base_dir / "precompiled"}; | ||
| 344 | if (!Common::FS::CreateDir(shader_dir) || !Common::FS::CreateDir(base_dir) || | ||
| 345 | !Common::FS::CreateDir(transferable_dir) || !Common::FS::CreateDir(precompiled_dir)) { | ||
| 346 | LOG_ERROR(Common_Filesystem, "Failed to create pipeline cache directories"); | 343 | LOG_ERROR(Common_Filesystem, "Failed to create pipeline cache directories"); |
| 347 | return; | 344 | return; |
| 348 | } | 345 | } |
| 349 | pipeline_cache_filename = transferable_dir / fmt::format("{:016x}.bin", title_id); | 346 | pipeline_cache_filename = base_dir / "vulkan.bin"; |
| 350 | 347 | ||
| 351 | struct { | 348 | struct { |
| 352 | std::mutex mutex; | 349 | std::mutex mutex; |
| 353 | size_t total{0}; | 350 | size_t total{}; |
| 354 | size_t built{0}; | 351 | size_t built{}; |
| 355 | bool has_loaded{false}; | 352 | bool has_loaded{}; |
| 356 | } state; | 353 | } state; |
| 357 | 354 | ||
| 358 | const auto load_compute{[&](std::ifstream& file, FileEnvironment env) { | 355 | const auto load_compute{[&](std::ifstream& file, FileEnvironment env) { |