Class CompositorFrameTiming

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

    public class CompositorFrameTiming
    extends Struct
    implements NativeResource
    Provides a single frame's timing information to the app.

    Member documentation

    • m_nSize – Set to sizeof( Compositor_FrameTiming )
    • m_nNumFramePresents – number of times this frame was presented
    • m_nNumMisPresented – number of times this frame was presented on a vsync other than it was originally predicted to
    • m_nNumDroppedFrames – number of additional times previous frame was scanned out
    • m_flSystemTimeInSeconds – Absolute time reference for comparing frames. This aligns with the vsync that running start is relative to.
    • m_flPreSubmitGpuMs – time spent rendering the scene (gpu work submitted between WaitGetPoses and second Submit)
    • m_flPostSubmitGpuMs – additional time spent rendering by application (e.g. companion window)
    • m_flTotalRenderGpuMs – time between work submitted immediately after present (ideally vsync) until the end of compositor submitted work
    • m_flCompositorRenderGpuMs – time spend performing distortion correction, rendering chaperone, overlays, etc.
    • m_flCompositorRenderCpuMs – time spent on cpu submitting the above work for this frame
    • m_flCompositorIdleCpuMs – time spent waiting for running start (application could have used this much more time)
    • m_flClientFrameIntervalMs – time between calls to WaitGetPoses
    • m_flPresentCallCpuMs – time blocked on call to present (usually 0.0, but can go long)
    • m_flWaitForPresentCpuMs – time spent spin-waiting for frame index to change (not near-zero indicates wait object failure)
    • m_flSubmitFrameMs – time spent in Submit (not near-zero indicates driver issue)
    • m_flNewFrameReadyMs – second call to Submit
    • m_HmdPose – pose used by app to render this frame


     struct Compositor_FrameTiming {
         uint32_t m_nSize;
         uint32_t m_nFrameIndex;
         uint32_t m_nNumFramePresents;
         uint32_t m_nNumMisPresented;
         uint32_t m_nNumDroppedFrames;
         uint32_t m_nReprojectionFlags;
         double m_flSystemTimeInSeconds;
         float m_flPreSubmitGpuMs;
         float m_flPostSubmitGpuMs;
         float m_flTotalRenderGpuMs;
         float m_flCompositorRenderGpuMs;
         float m_flCompositorRenderCpuMs;
         float m_flCompositorIdleCpuMs;
         float m_flClientFrameIntervalMs;
         float m_flPresentCallCpuMs;
         float m_flWaitForPresentCpuMs;
         float m_flSubmitFrameMs;
         float m_flWaitGetPosesCalledMs;
         float m_flNewPosesReadyMs;
         float m_flNewFrameReadyMs;
         float m_flCompositorUpdateStartMs;
         float m_flCompositorUpdateEndMs;
         float m_flCompositorRenderStartMs;
         TrackedDevicePose_t m_HmdPose;
         uint32_t m_nNumVSyncsReadyForUse;
         uint32_t m_nNumVSyncsToFirstView;
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        The struct member offsets.
    • Constructor Detail

      • CompositorFrameTiming

        public CompositorFrameTiming​(java.nio.ByteBuffer container)
        Creates a CompositorFrameTiming 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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • m_nSize

        public int m_nSize()
        Returns the value of the m_nSize field.
      • m_nFrameIndex

        public int m_nFrameIndex()
        Returns the value of the m_nFrameIndex field.
      • m_nNumFramePresents

        public int m_nNumFramePresents()
        Returns the value of the m_nNumFramePresents field.
      • m_nNumMisPresented

        public int m_nNumMisPresented()
        Returns the value of the m_nNumMisPresented field.
      • m_nNumDroppedFrames

        public int m_nNumDroppedFrames()
        Returns the value of the m_nNumDroppedFrames field.
      • m_nReprojectionFlags

        public int m_nReprojectionFlags()
        Returns the value of the m_nReprojectionFlags field.
      • m_flSystemTimeInSeconds

        public double m_flSystemTimeInSeconds()
        Returns the value of the m_flSystemTimeInSeconds field.
      • m_flPreSubmitGpuMs

        public float m_flPreSubmitGpuMs()
        Returns the value of the m_flPreSubmitGpuMs field.
      • m_flPostSubmitGpuMs

        public float m_flPostSubmitGpuMs()
        Returns the value of the m_flPostSubmitGpuMs field.
      • m_flTotalRenderGpuMs

        public float m_flTotalRenderGpuMs()
        Returns the value of the m_flTotalRenderGpuMs field.
      • m_flCompositorRenderGpuMs

        public float m_flCompositorRenderGpuMs()
        Returns the value of the m_flCompositorRenderGpuMs field.
      • m_flCompositorRenderCpuMs

        public float m_flCompositorRenderCpuMs()
        Returns the value of the m_flCompositorRenderCpuMs field.
      • m_flCompositorIdleCpuMs

        public float m_flCompositorIdleCpuMs()
        Returns the value of the m_flCompositorIdleCpuMs field.
      • m_flClientFrameIntervalMs

        public float m_flClientFrameIntervalMs()
        Returns the value of the m_flClientFrameIntervalMs field.
      • m_flPresentCallCpuMs

        public float m_flPresentCallCpuMs()
        Returns the value of the m_flPresentCallCpuMs field.
      • m_flWaitForPresentCpuMs

        public float m_flWaitForPresentCpuMs()
        Returns the value of the m_flWaitForPresentCpuMs field.
      • m_flSubmitFrameMs

        public float m_flSubmitFrameMs()
        Returns the value of the m_flSubmitFrameMs field.
      • m_flWaitGetPosesCalledMs

        public float m_flWaitGetPosesCalledMs()
        Returns the value of the m_flWaitGetPosesCalledMs field.
      • m_flNewPosesReadyMs

        public float m_flNewPosesReadyMs()
        Returns the value of the m_flNewPosesReadyMs field.
      • m_flNewFrameReadyMs

        public float m_flNewFrameReadyMs()
        Returns the value of the m_flNewFrameReadyMs field.
      • m_flCompositorUpdateStartMs

        public float m_flCompositorUpdateStartMs()
        Returns the value of the m_flCompositorUpdateStartMs field.
      • m_flCompositorUpdateEndMs

        public float m_flCompositorUpdateEndMs()
        Returns the value of the m_flCompositorUpdateEndMs field.
      • m_flCompositorRenderStartMs

        public float m_flCompositorRenderStartMs()
        Returns the value of the m_flCompositorRenderStartMs field.
      • m_nNumVSyncsReadyForUse

        public int m_nNumVSyncsReadyForUse()
        Returns the value of the m_nNumVSyncsReadyForUse field.
      • m_nNumVSyncsToFirstView

        public int m_nNumVSyncsToFirstView()
        Returns the value of the m_nNumVSyncsToFirstView field.
      • malloc

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

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

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

        public static CompositorFrameTiming createSafe​(long address)
        Like create, but returns null if address is NULL.
      • callocStack

        public static CompositorFrameTiming callocStack()
        Returns a new CompositorFrameTiming instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static CompositorFrameTiming mallocStack​(MemoryStack stack)
        Returns a new CompositorFrameTiming instance allocated on the specified MemoryStack.
        stack - the stack from which to allocate
      • callocStack

        public static CompositorFrameTiming callocStack​(MemoryStack stack)
        Returns a new CompositorFrameTiming instance allocated on the specified MemoryStack and initializes all its bits to zero.
        stack - the stack from which to allocate
      • nm_nSize

        public static int nm_nSize​(long struct)
        Unsafe version of m_nSize().
      • nm_nFrameIndex

        public static int nm_nFrameIndex​(long struct)
        Unsafe version of m_nFrameIndex().
      • nm_nNumFramePresents

        public static int nm_nNumFramePresents​(long struct)
        Unsafe version of m_nNumFramePresents().
      • nm_nNumMisPresented

        public static int nm_nNumMisPresented​(long struct)
        Unsafe version of m_nNumMisPresented().
      • nm_nNumDroppedFrames

        public static int nm_nNumDroppedFrames​(long struct)
        Unsafe version of m_nNumDroppedFrames().
      • nm_nReprojectionFlags

        public static int nm_nReprojectionFlags​(long struct)
        Unsafe version of m_nReprojectionFlags().
      • nm_flSystemTimeInSeconds

        public static double nm_flSystemTimeInSeconds​(long struct)
        Unsafe version of m_flSystemTimeInSeconds().
      • nm_flPreSubmitGpuMs

        public static float nm_flPreSubmitGpuMs​(long struct)
        Unsafe version of m_flPreSubmitGpuMs().
      • nm_flPostSubmitGpuMs

        public static float nm_flPostSubmitGpuMs​(long struct)
        Unsafe version of m_flPostSubmitGpuMs().
      • nm_flTotalRenderGpuMs

        public static float nm_flTotalRenderGpuMs​(long struct)
        Unsafe version of m_flTotalRenderGpuMs().
      • nm_flCompositorRenderGpuMs

        public static float nm_flCompositorRenderGpuMs​(long struct)
        Unsafe version of m_flCompositorRenderGpuMs().
      • nm_flCompositorRenderCpuMs

        public static float nm_flCompositorRenderCpuMs​(long struct)
        Unsafe version of m_flCompositorRenderCpuMs().
      • nm_flCompositorIdleCpuMs

        public static float nm_flCompositorIdleCpuMs​(long struct)
        Unsafe version of m_flCompositorIdleCpuMs().
      • nm_flClientFrameIntervalMs

        public static float nm_flClientFrameIntervalMs​(long struct)
        Unsafe version of m_flClientFrameIntervalMs().
      • nm_flPresentCallCpuMs

        public static float nm_flPresentCallCpuMs​(long struct)
        Unsafe version of m_flPresentCallCpuMs().
      • nm_flWaitForPresentCpuMs

        public static float nm_flWaitForPresentCpuMs​(long struct)
        Unsafe version of m_flWaitForPresentCpuMs().
      • nm_flSubmitFrameMs

        public static float nm_flSubmitFrameMs​(long struct)
        Unsafe version of m_flSubmitFrameMs().
      • nm_flWaitGetPosesCalledMs

        public static float nm_flWaitGetPosesCalledMs​(long struct)
        Unsafe version of m_flWaitGetPosesCalledMs().
      • nm_flNewPosesReadyMs

        public static float nm_flNewPosesReadyMs​(long struct)
        Unsafe version of m_flNewPosesReadyMs().
      • nm_flNewFrameReadyMs

        public static float nm_flNewFrameReadyMs​(long struct)
        Unsafe version of m_flNewFrameReadyMs().
      • nm_flCompositorUpdateStartMs

        public static float nm_flCompositorUpdateStartMs​(long struct)
      • nm_flCompositorUpdateEndMs

        public static float nm_flCompositorUpdateEndMs​(long struct)
        Unsafe version of m_flCompositorUpdateEndMs().
      • nm_flCompositorRenderStartMs

        public static float nm_flCompositorRenderStartMs​(long struct)
      • nm_nNumVSyncsReadyForUse

        public static int nm_nNumVSyncsReadyForUse​(long struct)
        Unsafe version of m_nNumVSyncsReadyForUse().
      • nm_nNumVSyncsToFirstView

        public static int nm_nNumVSyncsToFirstView​(long struct)
        Unsafe version of m_nNumVSyncsToFirstView().