Package org.lwjgl.ovr

Class OVRPerfStats

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class OVRPerfStats
    extends Struct
    implements NativeResource
    This is a complete descriptor of the performance stats provided by the SDK.

    Member documentation

    • FrameStats – an array of performance stats.

      The performance entries will be ordered in reverse chronological order such that the first entry will be the most recent one.

    • FrameStatsCount – will have a maximum value set by MaxProvidedFrameStats.

      If the application calls GetPerfStats at the native refresh rate of the HMD then FrameStatsCount will be 1. If the app's workload happens to force GetPerfStats to be called at a lower rate, then FrameStatsCount will be 2 or more.

      If the app does not want to miss any performance data for any frame, it needs to ensure that it is calling SubmitFrame and GetPerfStats at a rate that is at least: HMD_refresh_rate / ovrMaxProvidedFrameStats. On the Oculus Rift CV1 HMD, this will be equal to 18 times per second.

    • AnyFrameStatsDropped – If the app calls SubmitFrame at a rate less than 18 fps, then when calling GetPerfStats, expect AnyFrameStatsDropped to become True while FrameStatsCount is equal to MaxProvidedFrameStats.
    • AdaptiveGpuPerformanceScale – an edge-filtered value that a caller can use to adjust the graphics quality of the application to keep the GPU utilization in check. The value is calculated as: (desired_GPU_utilization / current_GPU_utilization)

      As such, when this value is 1.0, the GPU is doing the right amount of work for the app. Lower values mean the app needs to pull back on the GPU utilization. If the app is going to directly drive render-target resolution using this value, then be sure to take the square-root of the value before scaling the resolution with it. Changing render target resolutions however is one of the many things an app can do increase or decrease the amount of GPU utilization. Since AdaptiveGpuPerformanceScale is edge-filtered and does not change rapidly (i.e. reports non-1.0 values once every couple of seconds) the app can make the necessary adjustments and then keep watching the value to see if it has been satisfied.

    • AswIsAvailable – Will be true if Async Spacewarp (ASW) is available for this system which is dependent on several factors such as choice of GPU, OS and debug overrides.
    • VisibleProcessId – Contains the Process ID of the VR application the stats are being polled for. If an app continues to grab perf stats even when it is not visible, then expect this value to point to the other VR app that has grabbed focus (i.e. became visible).

    Layout

    
     struct ovrPerfStats {
         ovrPerfStatsPerCompositorFrame FrameStats[ovrMaxProvidedFrameStats];
         int FrameStatsCount;
         ovrBool AnyFrameStatsDropped;
         float AdaptiveGpuPerformanceScale;
         ovrBool AswIsAvailable;
         ovrProcessId VisibleProcessId;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • FRAMESTATS, FRAMESTATSCOUNT, ANYFRAMESTATSDROPPED, ADAPTIVEGPUPERFORMANCESCALE, ASWISAVAILABLE, VISIBLEPROCESSID

        The struct member offsets.
    • Constructor Detail

      • OVRPerfStats

        public OVRPerfStats​(java.nio.ByteBuffer container)
        Creates a OVRPerfStats instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.