mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 03:54:45 +00:00
GetGpuClock64
some game requested it (3), but GetGpuClock64 is correct? What exactly should it return?
This commit is contained in:
parent
2ee6575240
commit
287ecd434f
1 changed files with 11 additions and 0 deletions
|
@ -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<std::chrono::nanoseconds>(duration).count();
|
||||
return static_cast<uint64_t>(ticks);
|
||||
}
|
||||
|
||||
void SignalFence() const {
|
||||
switch (data_sel.Value()) {
|
||||
case DataSelect::None: {
|
||||
|
@ -325,6 +332,10 @@ struct PM4CmdEventWriteEop {
|
|||
*Address<u64>() = DataQWord();
|
||||
break;
|
||||
}
|
||||
case DataSelect::GpuClock64: {
|
||||
*Address<u64>() = GetGpuClock64();
|
||||
break;
|
||||
}
|
||||
case DataSelect::PerfCounter: {
|
||||
*Address<u64>() = Common::FencedRDTSC();
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue