summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/file_sys/vfs.cpp4
-rw-r--r--src/core/file_sys/vfs.h3
-rw-r--r--src/core/file_sys/vfs_real.cpp29
-rw-r--r--src/core/file_sys/vfs_real.h1
-rw-r--r--src/core/file_sys/vfs_types.h9
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp12
-rw-r--r--src/core/hle/service/filesystem/filesystem.h6
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp20
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp2
-rw-r--r--src/video_core/vulkan_common/vulkan_debug_callback.cpp1
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp17
12 files changed, 91 insertions, 15 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp
index 368419eca..f5ad10b15 100644
--- a/src/core/file_sys/vfs.cpp
+++ b/src/core/file_sys/vfs.cpp
@@ -273,6 +273,10 @@ VirtualFile VfsDirectory::GetFile(std::string_view name) const {
273 return iter == files.end() ? nullptr : *iter; 273 return iter == files.end() ? nullptr : *iter;
274} 274}
275 275
276FileTimeStampRaw VfsDirectory::GetFileTimeStamp([[maybe_unused]] std::string_view path) const {
277 return {};
278}
279
276VirtualDir VfsDirectory::GetSubdirectory(std::string_view name) const { 280VirtualDir VfsDirectory::GetSubdirectory(std::string_view name) const {
277 const auto& subs = GetSubdirectories(); 281 const auto& subs = GetSubdirectories();
278 const auto iter = std::find_if(subs.begin(), subs.end(), 282 const auto iter = std::find_if(subs.begin(), subs.end(),
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h
index afd64e95c..ff6935da6 100644
--- a/src/core/file_sys/vfs.h
+++ b/src/core/file_sys/vfs.h
@@ -199,6 +199,9 @@ public:
199 // file with name. 199 // file with name.
200 virtual VirtualFile GetFile(std::string_view name) const; 200 virtual VirtualFile GetFile(std::string_view name) const;
201 201
202 // Returns a struct containing the file's timestamp.
203 virtual FileTimeStampRaw GetFileTimeStamp(std::string_view path) const;
204
202 // Returns a vector containing all of the subdirectories in this directory. 205 // Returns a vector containing all of the subdirectories in this directory.
203 virtual std::vector<VirtualDir> GetSubdirectories() const = 0; 206 virtual std::vector<VirtualDir> GetSubdirectories() const = 0;
204 // Returns the directory with name matching name. Returns nullptr if directory dosen't have a 207 // Returns the directory with name matching name. Returns nullptr if directory dosen't have a
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index 3dad54f49..f4073b76a 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -13,6 +13,13 @@
13#include "common/logging/log.h" 13#include "common/logging/log.h"
14#include "core/file_sys/vfs_real.h" 14#include "core/file_sys/vfs_real.h"
15 15
16// For FileTimeStampRaw
17#include <sys/stat.h>
18
19#ifdef _MSC_VER
20#define stat _stat64
21#endif
22
16namespace FileSys { 23namespace FileSys {
17 24
18namespace FS = Common::FS; 25namespace FS = Common::FS;
@@ -392,6 +399,28 @@ std::vector<VirtualFile> RealVfsDirectory::GetFiles() const {
392 return IterateEntries<RealVfsFile, VfsFile>(); 399 return IterateEntries<RealVfsFile, VfsFile>();
393} 400}
394 401
402FileTimeStampRaw RealVfsDirectory::GetFileTimeStamp(std::string_view path_) const {
403 const auto full_path = FS::SanitizePath(path + '/' + std::string(path_));
404 const auto fs_path = std::filesystem::path{FS::ToU8String(full_path)};
405 struct stat file_status;
406
407#ifdef _WIN32
408 const auto stat_result = _wstat64(fs_path.c_str(), &file_status);
409#else
410 const auto stat_result = stat(fs_path.c_str(), &file_status);
411#endif
412
413 if (stat_result != 0) {
414 return {};
415 }
416
417 return {
418 .created{static_cast<u64>(file_status.st_ctime)},
419 .accessed{static_cast<u64>(file_status.st_atime)},
420 .modified{static_cast<u64>(file_status.st_mtime)},
421 };
422}
423
395std::vector<VirtualDir> RealVfsDirectory::GetSubdirectories() const { 424std::vector<VirtualDir> RealVfsDirectory::GetSubdirectories() const {
396 return IterateEntries<RealVfsDirectory, VfsDirectory>(); 425 return IterateEntries<RealVfsDirectory, VfsDirectory>();
397} 426}
diff --git a/src/core/file_sys/vfs_real.h b/src/core/file_sys/vfs_real.h
index e4d1bba79..746e624cb 100644
--- a/src/core/file_sys/vfs_real.h
+++ b/src/core/file_sys/vfs_real.h
@@ -86,6 +86,7 @@ public:
86 VirtualDir CreateDirectoryRelative(std::string_view relative_path) override; 86 VirtualDir CreateDirectoryRelative(std::string_view relative_path) override;
87 bool DeleteSubdirectoryRecursive(std::string_view name) override; 87 bool DeleteSubdirectoryRecursive(std::string_view name) override;
88 std::vector<VirtualFile> GetFiles() const override; 88 std::vector<VirtualFile> GetFiles() const override;
89 FileTimeStampRaw GetFileTimeStamp(std::string_view path) const override;
89 std::vector<VirtualDir> GetSubdirectories() const override; 90 std::vector<VirtualDir> GetSubdirectories() const override;
90 bool IsWritable() const override; 91 bool IsWritable() const override;
91 bool IsReadable() const override; 92 bool IsReadable() const override;
diff --git a/src/core/file_sys/vfs_types.h b/src/core/file_sys/vfs_types.h
index 6215ed7af..ed0724717 100644
--- a/src/core/file_sys/vfs_types.h
+++ b/src/core/file_sys/vfs_types.h
@@ -6,6 +6,8 @@
6 6
7#include <memory> 7#include <memory>
8 8
9#include "common/common_types.h"
10
9namespace FileSys { 11namespace FileSys {
10 12
11class VfsDirectory; 13class VfsDirectory;
@@ -18,4 +20,11 @@ using VirtualDir = std::shared_ptr<VfsDirectory>;
18using VirtualFile = std::shared_ptr<VfsFile>; 20using VirtualFile = std::shared_ptr<VfsFile>;
19using VirtualFilesystem = std::shared_ptr<VfsFilesystem>; 21using VirtualFilesystem = std::shared_ptr<VfsFilesystem>;
20 22
23struct FileTimeStampRaw {
24 u64 created{};
25 u64 accessed{};
26 u64 modified{};
27 u64 padding{};
28};
29
21} // namespace FileSys 30} // namespace FileSys
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index c8d65f328..f8f9e32f7 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -261,6 +261,18 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType(
261 return FileSys::ERROR_PATH_NOT_FOUND; 261 return FileSys::ERROR_PATH_NOT_FOUND;
262} 262}
263 263
264ResultVal<FileSys::FileTimeStampRaw> VfsDirectoryServiceWrapper::GetFileTimeStampRaw(
265 const std::string& path) const {
266 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
267 if (dir == nullptr) {
268 return FileSys::ERROR_PATH_NOT_FOUND;
269 }
270 if (GetEntryType(path).Failed()) {
271 return FileSys::ERROR_PATH_NOT_FOUND;
272 }
273 return MakeResult(dir->GetFileTimeStamp(Common::FS::GetFilename(path)));
274}
275
264FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} 276FileSystemController::FileSystemController(Core::System& system_) : system{system_} {}
265 277
266FileSystemController::~FileSystemController() = default; 278FileSystemController::~FileSystemController() = default;
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index d387af3cb..b155e0811 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -240,6 +240,12 @@ public:
240 */ 240 */
241 ResultVal<FileSys::EntryType> GetEntryType(const std::string& path) const; 241 ResultVal<FileSys::EntryType> GetEntryType(const std::string& path) const;
242 242
243 /**
244 * Get the timestamp of the specified path
245 * @return The timestamp of the specified path or error code
246 */
247 ResultVal<FileSys::FileTimeStampRaw> GetFileTimeStampRaw(const std::string& path) const;
248
243private: 249private:
244 FileSys::VirtualDir backing; 250 FileSys::VirtualDir backing;
245}; 251};
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index db4d44c12..50c788dd6 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -326,7 +326,7 @@ public:
326 {11, &IFileSystem::GetFreeSpaceSize, "GetFreeSpaceSize"}, 326 {11, &IFileSystem::GetFreeSpaceSize, "GetFreeSpaceSize"},
327 {12, &IFileSystem::GetTotalSpaceSize, "GetTotalSpaceSize"}, 327 {12, &IFileSystem::GetTotalSpaceSize, "GetTotalSpaceSize"},
328 {13, &IFileSystem::CleanDirectoryRecursively, "CleanDirectoryRecursively"}, 328 {13, &IFileSystem::CleanDirectoryRecursively, "CleanDirectoryRecursively"},
329 {14, nullptr, "GetFileTimeStampRaw"}, 329 {14, &IFileSystem::GetFileTimeStampRaw, "GetFileTimeStampRaw"},
330 {15, nullptr, "QueryEntry"}, 330 {15, nullptr, "QueryEntry"},
331 }; 331 };
332 RegisterHandlers(functions); 332 RegisterHandlers(functions);
@@ -501,6 +501,24 @@ public:
501 rb.Push(size.get_total_size()); 501 rb.Push(size.get_total_size());
502 } 502 }
503 503
504 void GetFileTimeStampRaw(Kernel::HLERequestContext& ctx) {
505 const auto file_buffer = ctx.ReadBuffer();
506 const std::string name = Common::StringFromBuffer(file_buffer);
507
508 LOG_WARNING(Service_FS, "(Partial Implementation) called. file={}", name);
509
510 auto result = backend.GetFileTimeStampRaw(name);
511 if (result.Failed()) {
512 IPC::ResponseBuilder rb{ctx, 2};
513 rb.Push(result.Code());
514 return;
515 }
516
517 IPC::ResponseBuilder rb{ctx, 10};
518 rb.Push(ResultSuccess);
519 rb.PushRaw(*result);
520 }
521
504private: 522private:
505 VfsDirectoryServiceWrapper backend; 523 VfsDirectoryServiceWrapper backend;
506 SizeGetter size; 524 SizeGetter size;
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index b0e14182e..02682bd76 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -293,6 +293,8 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
293 }}; 293 }};
294 LoadPipelines(stop_loading, shader_cache_filename, CACHE_VERSION, load_compute, load_graphics); 294 LoadPipelines(stop_loading, shader_cache_filename, CACHE_VERSION, load_compute, load_graphics);
295 295
296 LOG_INFO(Render_OpenGL, "Total Pipeline Count: {}", state.total);
297
296 std::unique_lock lock{state.mutex}; 298 std::unique_lock lock{state.mutex};
297 callback(VideoCore::LoadCallbackStage::Build, 0, state.total); 299 callback(VideoCore::LoadCallbackStage::Build, 0, state.total);
298 state.has_loaded = true; 300 state.has_loaded = true;
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 31bfbcb06..eb8b4e08b 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -447,6 +447,8 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading
447 VideoCommon::LoadPipelines(stop_loading, pipeline_cache_filename, CACHE_VERSION, load_compute, 447 VideoCommon::LoadPipelines(stop_loading, pipeline_cache_filename, CACHE_VERSION, load_compute,
448 load_graphics); 448 load_graphics);
449 449
450 LOG_INFO(Render_Vulkan, "Total Pipeline Count: {}", state.total);
451
450 std::unique_lock lock{state.mutex}; 452 std::unique_lock lock{state.mutex};
451 callback(VideoCore::LoadCallbackStage::Build, 0, state.total); 453 callback(VideoCore::LoadCallbackStage::Build, 0, state.total);
452 state.has_loaded = true; 454 state.has_loaded = true;
diff --git a/src/video_core/vulkan_common/vulkan_debug_callback.cpp b/src/video_core/vulkan_common/vulkan_debug_callback.cpp
index 0f60765bb..cf94e1d39 100644
--- a/src/video_core/vulkan_common/vulkan_debug_callback.cpp
+++ b/src/video_core/vulkan_common/vulkan_debug_callback.cpp
@@ -16,6 +16,7 @@ VkBool32 Callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
16 switch (static_cast<u32>(data->messageIdNumber)) { 16 switch (static_cast<u32>(data->messageIdNumber)) {
17 case 0x682a878au: // VUID-vkCmdBindVertexBuffers2EXT-pBuffers-parameter 17 case 0x682a878au: // VUID-vkCmdBindVertexBuffers2EXT-pBuffers-parameter
18 case 0x99fb7dfdu: // UNASSIGNED-RequiredParameter (vkCmdBindVertexBuffers2EXT pBuffers[0]) 18 case 0x99fb7dfdu: // UNASSIGNED-RequiredParameter (vkCmdBindVertexBuffers2EXT pBuffers[0])
19 case 0xe8616bf2u: // Bound VkDescriptorSet 0x0[] was destroyed. Likely push_descriptor related
19 return VK_FALSE; 20 return VK_FALSE;
20 default: 21 default:
21 break; 22 break;
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 24fb50db9..c2ec9f76a 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -243,7 +243,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
243 SetupFamilies(surface); 243 SetupFamilies(surface);
244 SetupFeatures(); 244 SetupFeatures();
245 SetupProperties(); 245 SetupProperties();
246 CollectTelemetryParameters();
247 246
248 const auto queue_cis = GetDeviceQueueCreateInfos(); 247 const auto queue_cis = GetDeviceQueueCreateInfos();
249 const std::vector extensions = LoadExtensions(surface != nullptr); 248 const std::vector extensions = LoadExtensions(surface != nullptr);
@@ -369,20 +368,9 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
369 }; 368 };
370 SetNext(next, demote); 369 SetNext(next, demote);
371 370
372 if (driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE) { 371 VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8;
373 const u32 version = properties.driverVersion;
374 // Broken in this driver
375 if (version > VK_MAKE_API_VERSION(0, 2, 0, 193)) {
376 LOG_WARNING(Render_Vulkan, "AMD proprietary driver versions newer than 21.9.1 "
377 "(windows) / 0.2.0.194 (amdvlk) have "
378 "broken VkPhysicalDeviceFloat16Int8FeaturesKHR");
379 is_int8_supported = false;
380 is_float16_supported = false;
381 }
382 }
383
384 if (is_int8_supported || is_float16_supported) { 372 if (is_int8_supported || is_float16_supported) {
385 VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8{ 373 float16_int8 = {
386 .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, 374 .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR,
387 .pNext = nullptr, 375 .pNext = nullptr,
388 .shaderFloat16 = is_float16_supported, 376 .shaderFloat16 = is_float16_supported,
@@ -573,6 +561,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
573 logical = vk::Device::Create(physical, queue_cis, extensions, first_next, dld); 561 logical = vk::Device::Create(physical, queue_cis, extensions, first_next, dld);
574 562
575 CollectPhysicalMemoryInfo(); 563 CollectPhysicalMemoryInfo();
564 CollectTelemetryParameters();
576 CollectToolingInfo(); 565 CollectToolingInfo();
577 566
578 if (driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR) { 567 if (driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR) {