diff --git a/src/video_core/amdgpu/pm4_cmds.h b/src/video_core/amdgpu/pm4_cmds.h index 7f5ebb603..57f78df8a 100644 --- a/src/video_core/amdgpu/pm4_cmds.h +++ b/src/video_core/amdgpu/pm4_cmds.h @@ -312,6 +312,13 @@ struct PM4CmdEventWriteEop { 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() const { switch (data_sel.Value()) { case DataSelect::None: { @@ -336,7 +343,7 @@ struct PM4CmdEventWriteEop { switch (int_sel.Value()) { case InterruptSelect::None: { - // No interrupt + *Address() = GetGpuClock64(); break; } case InterruptSelect::IrqOnly: