mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 03:54:45 +00:00
Update pm4_cmds.h
This commit is contained in:
parent
0da3adba9a
commit
963c7e56de
1 changed files with 9 additions and 2 deletions
|
@ -343,7 +343,7 @@ struct PM4CmdEventWriteEop {
|
|||
|
||||
switch (int_sel.Value()) {
|
||||
case InterruptSelect::None: {
|
||||
*Address<u64>() = GetGpuClock64();
|
||||
// No interrupt
|
||||
break;
|
||||
}
|
||||
case InterruptSelect::IrqOnly:
|
||||
|
@ -659,6 +659,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<std::chrono::nanoseconds>(duration).count();
|
||||
return static_cast<uint64_t>(ticks);
|
||||
}
|
||||
|
||||
void SignalFence(Platform::InterruptId irq_id) const {
|
||||
switch (data_sel.Value()) {
|
||||
case DataSelect::Data32Low: {
|
||||
|
@ -670,7 +677,7 @@ struct PM4CmdReleaseMem {
|
|||
break;
|
||||
}
|
||||
case DataSelect::GpuClock64: {
|
||||
// TODO
|
||||
*Address<u64>() = GetGpuClock64();
|
||||
break;
|
||||
}
|
||||
case DataSelect::PerfCounter: {
|
||||
|
|
Loading…
Add table
Reference in a new issue