Forum Discussion
JoeriCG
4 years agoExplorer
Get GPU frametime on Quest
I'm trying to implement Unity's Dynamic Resolution as a quick fix for the remaining GPU-bound scenarios in our game, but I'm running into the issue that I can't seem to get the last GPU frametime no matter what API I use. Neither FrameTimingManager.GetLatestTimings, XRStats.TryGetGPUTimeLastFrame, nor XRDisplaySubsystem.TryGetAppGPUTimeLastFrame seem to work on my Quest 2 (but do in-editor via Link). What is the preferred method to get the GPU frametime on Quest?
To clarify, the game is using Vulkan and the VRAPI (not OpenXR).
2 Replies
Replies have been turned off for this discussion
- lordzargonHonored Guest
I'm having this exact issue. Did you ever find a solution? I've tried no less than 6 different API calls to try and get this information, yet they all fail or return 0.
- lordzargonHonored Guest
I got it.
You need this in your Start/Awake function (or whenever you want to start tracking the GPU App time)
void OnEnable() { Unity.XR.Oculus.Stats.PerfMetrics.EnablePerfMetrics(true); } void OnDisable() { Unity.XR.Oculus.Stats.PerfMetrics.EnablePerfMetrics(false); }Then, in your Update...
float appGPUTime = Unity.XR.Oculus.Stats.PerfMetrics.AppGPUTime;That got it for me.
Hope that helps!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 4 months ago
- 2 years ago