Update pm4_cmds.h

This commit is contained in:
DanielSvoboda 2024-08-02 21:22:15 -03:00 committed by GitHub
parent 0da3adba9a
commit 963c7e56de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: {