SampleCountFlagBits::e16 - GetGpuClock64 (#360)

* SampleCountFlagBits::e16

* GpuClock64

* GpuClock64

* Update pm4_cmds.h

* Update pm4_cmds.h
This commit is contained in:
DanielSvoboda 2024-08-04 10:49:43 -03:00 committed by GitHub
parent 21462523de
commit 7308864537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -652,6 +652,13 @@ struct PM4CmdReleaseMem {
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(Platform::InterruptId irq_id) const { void SignalFence(Platform::InterruptId irq_id) const {
switch (data_sel.Value()) { switch (data_sel.Value()) {
case DataSelect::Data32Low: { case DataSelect::Data32Low: {
@ -662,6 +669,10 @@ struct PM4CmdReleaseMem {
*Address<u64>() = DataQWord(); *Address<u64>() = DataQWord();
break; break;
} }
case DataSelect::GpuClock64: {
*Address<u64>() = GetGpuClock64();
break;
}
case DataSelect::PerfCounter: { case DataSelect::PerfCounter: {
*Address<u64>() = Common::FencedRDTSC(); *Address<u64>() = Common::FencedRDTSC();
break; break;

View File

@ -681,6 +681,8 @@ vk::SampleCountFlagBits NumSamples(u32 num_samples) {
return vk::SampleCountFlagBits::e4; return vk::SampleCountFlagBits::e4;
case 8: case 8:
return vk::SampleCountFlagBits::e8; return vk::SampleCountFlagBits::e8;
case 16:
return vk::SampleCountFlagBits::e16;
default: default:
UNREACHABLE(); UNREACHABLE();
} }