From 7308864537d2fd5880485dd11f90e0c1810caa1b Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Sun, 4 Aug 2024 10:49:43 -0300 Subject: [PATCH] SampleCountFlagBits::e16 - GetGpuClock64 (#360) * SampleCountFlagBits::e16 * GpuClock64 * GpuClock64 * Update pm4_cmds.h * Update pm4_cmds.h --- src/video_core/amdgpu/pm4_cmds.h | 11 +++++++++++ src/video_core/renderer_vulkan/liverpool_to_vk.cpp | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/video_core/amdgpu/pm4_cmds.h b/src/video_core/amdgpu/pm4_cmds.h index 9b44da02..e5f618cc 100644 --- a/src/video_core/amdgpu/pm4_cmds.h +++ b/src/video_core/amdgpu/pm4_cmds.h @@ -652,6 +652,13 @@ struct PM4CmdReleaseMem { return data_lo | u64(data_hi) << 32; } + uint64_t GetGpuClock64() const { + auto now = std::chrono::high_resolution_clock::now(); + auto duration = now.time_since_epoch(); + auto ticks = std::chrono::duration_cast(duration).count(); + return static_cast(ticks); + } + void SignalFence(Platform::InterruptId irq_id) const { switch (data_sel.Value()) { case DataSelect::Data32Low: { @@ -662,6 +669,10 @@ struct PM4CmdReleaseMem { *Address() = DataQWord(); break; } + case DataSelect::GpuClock64: { + *Address() = GetGpuClock64(); + break; + } case DataSelect::PerfCounter: { *Address() = Common::FencedRDTSC(); break; diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp index e4539123..82ccf5af 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp @@ -681,6 +681,8 @@ vk::SampleCountFlagBits NumSamples(u32 num_samples) { return vk::SampleCountFlagBits::e4; case 8: return vk::SampleCountFlagBits::e8; + case 16: + return vk::SampleCountFlagBits::e16; default: UNREACHABLE(); }