diff options
| author | 2020-08-15 08:33:16 -0400 | |
|---|---|---|
| committer | 2020-08-16 06:52:40 -0400 | |
| commit | c4ed791164df7e3e74042a37a62077b4dc4ade91 (patch) | |
| tree | 12bbcc09d0db32a0b6b5dc1bc49245964486da63 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #4528 from lioncash/discard (diff) | |
| download | yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.tar.gz yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.tar.xz yuzu-c4ed791164df7e3e74042a37a62077b4dc4ade91.zip | |
common/fileutil: Convert namespace to Common::FS
Migrates a remaining common file over to the Common namespace, making it
consistent with the rest of common files.
This also allows for high-traffic FS related code to alias the
filesystem function namespace as
namespace FS = Common::FS;
for more concise typing.
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp b/src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp index 435c8c1b8..5b01020ec 100644 --- a/src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp +++ b/src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp | |||
| @@ -65,10 +65,10 @@ bool NsightAftermathTracker::Initialize() { | |||
| 65 | return false; | 65 | return false; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | dump_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir) + "gpucrash"; | 68 | dump_dir = Common::FS::GetUserPath(Common::FS::UserPath::LogDir) + "gpucrash"; |
| 69 | 69 | ||
| 70 | (void)FileUtil::DeleteDirRecursively(dump_dir); | 70 | (void)Common::FS::DeleteDirRecursively(dump_dir); |
| 71 | if (!FileUtil::CreateDir(dump_dir)) { | 71 | if (!Common::FS::CreateDir(dump_dir)) { |
| 72 | LOG_ERROR(Render_Vulkan, "Failed to create Nsight Aftermath dump directory"); | 72 | LOG_ERROR(Render_Vulkan, "Failed to create Nsight Aftermath dump directory"); |
| 73 | return false; | 73 | return false; |
| 74 | } | 74 | } |
| @@ -106,7 +106,7 @@ void NsightAftermathTracker::SaveShader(const std::vector<u32>& spirv) const { | |||
| 106 | return; | 106 | return; |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | FileUtil::IOFile file(fmt::format("{}/source_{:016x}.spv", dump_dir, hash.hash), "wb"); | 109 | Common::FS::IOFile file(fmt::format("{}/source_{:016x}.spv", dump_dir, hash.hash), "wb"); |
| 110 | if (!file.IsOpen()) { | 110 | if (!file.IsOpen()) { |
| 111 | LOG_ERROR(Render_Vulkan, "Failed to dump SPIR-V module with hash={:016x}", hash.hash); | 111 | LOG_ERROR(Render_Vulkan, "Failed to dump SPIR-V module with hash={:016x}", hash.hash); |
| 112 | return; | 112 | return; |
| @@ -156,12 +156,12 @@ void NsightAftermathTracker::OnGpuCrashDumpCallback(const void* gpu_crash_dump, | |||
| 156 | }(); | 156 | }(); |
| 157 | 157 | ||
| 158 | std::string_view dump_view(static_cast<const char*>(gpu_crash_dump), gpu_crash_dump_size); | 158 | std::string_view dump_view(static_cast<const char*>(gpu_crash_dump), gpu_crash_dump_size); |
| 159 | if (FileUtil::WriteStringToFile(false, base_name, dump_view) != gpu_crash_dump_size) { | 159 | if (Common::FS::WriteStringToFile(false, base_name, dump_view) != gpu_crash_dump_size) { |
| 160 | LOG_ERROR(Render_Vulkan, "Failed to write dump file"); | 160 | LOG_ERROR(Render_Vulkan, "Failed to write dump file"); |
| 161 | return; | 161 | return; |
| 162 | } | 162 | } |
| 163 | const std::string_view json_view(json.data(), json.size()); | 163 | const std::string_view json_view(json.data(), json.size()); |
| 164 | if (FileUtil::WriteStringToFile(true, base_name + ".json", json_view) != json.size()) { | 164 | if (Common::FS::WriteStringToFile(true, base_name + ".json", json_view) != json.size()) { |
| 165 | LOG_ERROR(Render_Vulkan, "Failed to write JSON"); | 165 | LOG_ERROR(Render_Vulkan, "Failed to write JSON"); |
| 166 | return; | 166 | return; |
| 167 | } | 167 | } |
| @@ -180,7 +180,7 @@ void NsightAftermathTracker::OnShaderDebugInfoCallback(const void* shader_debug_ | |||
| 180 | 180 | ||
| 181 | const std::string path = | 181 | const std::string path = |
| 182 | fmt::format("{}/shader_{:016x}{:016x}.nvdbg", dump_dir, identifier.id[0], identifier.id[1]); | 182 | fmt::format("{}/shader_{:016x}{:016x}.nvdbg", dump_dir, identifier.id[0], identifier.id[1]); |
| 183 | FileUtil::IOFile file(path, "wb"); | 183 | Common::FS::IOFile file(path, "wb"); |
| 184 | if (!file.IsOpen()) { | 184 | if (!file.IsOpen()) { |
| 185 | LOG_ERROR(Render_Vulkan, "Failed to create file {}", path); | 185 | LOG_ERROR(Render_Vulkan, "Failed to create file {}", path); |
| 186 | return; | 186 | return; |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 2258479f5..0c62c8061 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp | |||
| @@ -78,7 +78,7 @@ Common::DynamicLibrary OpenVulkanLibrary() { | |||
| 78 | if (!libvulkan_env || !library.Open(libvulkan_env)) { | 78 | if (!libvulkan_env || !library.Open(libvulkan_env)) { |
| 79 | // Use the libvulkan.dylib from the application bundle. | 79 | // Use the libvulkan.dylib from the application bundle. |
| 80 | const std::string filename = | 80 | const std::string filename = |
| 81 | FileUtil::GetBundleDirectory() + "/Contents/Frameworks/libvulkan.dylib"; | 81 | Common::FS::GetBundleDirectory() + "/Contents/Frameworks/libvulkan.dylib"; |
| 82 | library.Open(filename.c_str()); | 82 | library.Open(filename.c_str()); |
| 83 | } | 83 | } |
| 84 | #else | 84 | #else |