mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-31 14:35:19 +00:00
GpuClock64
This commit is contained in:
parent
eff0912ff9
commit
0da3adba9a
@ -312,6 +312,13 @@ struct PM4CmdEventWriteEop {
|
|||||||
return data_lo | u64(data_hi) << 32;
|
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 {
|
void SignalFence() const {
|
||||||
switch (data_sel.Value()) {
|
switch (data_sel.Value()) {
|
||||||
case DataSelect::None: {
|
case DataSelect::None: {
|
||||||
@ -336,7 +343,7 @@ struct PM4CmdEventWriteEop {
|
|||||||
|
|
||||||
switch (int_sel.Value()) {
|
switch (int_sel.Value()) {
|
||||||
case InterruptSelect::None: {
|
case InterruptSelect::None: {
|
||||||
// No interrupt
|
*Address<u64>() = GetGpuClock64();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InterruptSelect::IrqOnly:
|
case InterruptSelect::IrqOnly:
|
||||||
|
Loading…
Reference in New Issue
Block a user