Package org.lwjgl.ovr

Class OVRPerfStats

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<OVRPerfStats>
org.lwjgl.ovr.OVRPerfStats
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

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

Layout


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

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • FRAMESTATS

      public static final int FRAMESTATS
      The struct member offsets.
    • FRAMESTATSCOUNT

      public static final int FRAMESTATSCOUNT
      The struct member offsets.
    • ANYFRAMESTATSDROPPED

      public static final int ANYFRAMESTATSDROPPED
      The struct member offsets.
    • ADAPTIVEGPUPERFORMANCESCALE

      public static final int ADAPTIVEGPUPERFORMANCESCALE
      The struct member offsets.
    • ASWISAVAILABLE

      public static final int ASWISAVAILABLE
      The struct member offsets.
    • VISIBLEPROCESSID

      public static final int VISIBLEPROCESSID
      The struct member offsets.
  • Constructor Details

    • OVRPerfStats

      public OVRPerfStats(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.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<OVRPerfStats>
    • 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.

    • FrameStats

      public OVRPerfStatsPerCompositorFrame FrameStats(int index)
      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

      public int 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

      public boolean 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

      public float 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

      public boolean 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

      public int 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).
    • malloc

      public static OVRPerfStats malloc()
      Returns a new OVRPerfStats instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static OVRPerfStats calloc()
      Returns a new OVRPerfStats instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static OVRPerfStats create()
      Returns a new OVRPerfStats instance allocated with BufferUtils.
    • create

      public static OVRPerfStats create(long address)
      Returns a new OVRPerfStats instance for the specified memory address.
    • createSafe

      public static @Nullable OVRPerfStats createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static OVRPerfStats.Buffer malloc(int capacity)
      Returns a new OVRPerfStats.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static OVRPerfStats.Buffer calloc(int capacity)
      Returns a new OVRPerfStats.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static OVRPerfStats.Buffer create(int capacity)
      Returns a new OVRPerfStats.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static OVRPerfStats.Buffer create(long address, int capacity)
      Create a OVRPerfStats.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable OVRPerfStats.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static OVRPerfStats mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRPerfStats callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static OVRPerfStats mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRPerfStats callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static OVRPerfStats.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRPerfStats.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static OVRPerfStats.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRPerfStats.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static OVRPerfStats malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new OVRPerfStats instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static OVRPerfStats calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new OVRPerfStats instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static OVRPerfStats.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new OVRPerfStats.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static OVRPerfStats.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new OVRPerfStats.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nFrameStats

      public static OVRPerfStatsPerCompositorFrame.Buffer nFrameStats(long struct)
      Unsafe version of FrameStats().
    • nFrameStats

      public static OVRPerfStatsPerCompositorFrame nFrameStats(long struct, int index)
      Unsafe version of FrameStats.
    • nFrameStatsCount

      public static int nFrameStatsCount(long struct)
      Unsafe version of FrameStatsCount().
    • nAnyFrameStatsDropped

      public static boolean nAnyFrameStatsDropped(long struct)
      Unsafe version of AnyFrameStatsDropped().
    • nAdaptiveGpuPerformanceScale

      public static float nAdaptiveGpuPerformanceScale(long struct)
    • nAswIsAvailable

      public static boolean nAswIsAvailable(long struct)
      Unsafe version of AswIsAvailable().
    • nVisibleProcessId

      public static int nVisibleProcessId(long struct)
      Unsafe version of VisibleProcessId().