Class CompositorFrameTiming

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

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

Layout


 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 Details

    • SIZEOF

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

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

      public static final int M_NSIZE
      The struct member offsets.
    • M_NFRAMEINDEX

      public static final int M_NFRAMEINDEX
      The struct member offsets.
    • M_NNUMFRAMEPRESENTS

      public static final int M_NNUMFRAMEPRESENTS
      The struct member offsets.
    • M_NNUMMISPRESENTED

      public static final int M_NNUMMISPRESENTED
      The struct member offsets.
    • M_NNUMDROPPEDFRAMES

      public static final int M_NNUMDROPPEDFRAMES
      The struct member offsets.
    • M_NREPROJECTIONFLAGS

      public static final int M_NREPROJECTIONFLAGS
      The struct member offsets.
    • M_FLSYSTEMTIMEINSECONDS

      public static final int M_FLSYSTEMTIMEINSECONDS
      The struct member offsets.
    • M_FLPRESUBMITGPUMS

      public static final int M_FLPRESUBMITGPUMS
      The struct member offsets.
    • M_FLPOSTSUBMITGPUMS

      public static final int M_FLPOSTSUBMITGPUMS
      The struct member offsets.
    • M_FLTOTALRENDERGPUMS

      public static final int M_FLTOTALRENDERGPUMS
      The struct member offsets.
    • M_FLCOMPOSITORRENDERGPUMS

      public static final int M_FLCOMPOSITORRENDERGPUMS
      The struct member offsets.
    • M_FLCOMPOSITORRENDERCPUMS

      public static final int M_FLCOMPOSITORRENDERCPUMS
      The struct member offsets.
    • M_FLCOMPOSITORIDLECPUMS

      public static final int M_FLCOMPOSITORIDLECPUMS
      The struct member offsets.
    • M_FLCLIENTFRAMEINTERVALMS

      public static final int M_FLCLIENTFRAMEINTERVALMS
      The struct member offsets.
    • M_FLPRESENTCALLCPUMS

      public static final int M_FLPRESENTCALLCPUMS
      The struct member offsets.
    • M_FLWAITFORPRESENTCPUMS

      public static final int M_FLWAITFORPRESENTCPUMS
      The struct member offsets.
    • M_FLSUBMITFRAMEMS

      public static final int M_FLSUBMITFRAMEMS
      The struct member offsets.
    • M_FLWAITGETPOSESCALLEDMS

      public static final int M_FLWAITGETPOSESCALLEDMS
      The struct member offsets.
    • M_FLNEWPOSESREADYMS

      public static final int M_FLNEWPOSESREADYMS
      The struct member offsets.
    • M_FLNEWFRAMEREADYMS

      public static final int M_FLNEWFRAMEREADYMS
      The struct member offsets.
    • M_FLCOMPOSITORUPDATESTARTMS

      public static final int M_FLCOMPOSITORUPDATESTARTMS
      The struct member offsets.
    • M_FLCOMPOSITORUPDATEENDMS

      public static final int M_FLCOMPOSITORUPDATEENDMS
      The struct member offsets.
    • M_FLCOMPOSITORRENDERSTARTMS

      public static final int M_FLCOMPOSITORRENDERSTARTMS
      The struct member offsets.
    • M_HMDPOSE

      public static final int M_HMDPOSE
      The struct member offsets.
    • M_NNUMVSYNCSREADYFORUSE

      public static final int M_NNUMVSYNCSREADYFORUSE
      The struct member offsets.
    • M_NNUMVSYNCSTOFIRSTVIEW

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

    • CompositorFrameTiming

      public CompositorFrameTiming(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 Details

    • sizeof

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

      public int m_nSize()
      Set to sizeof( Compositor_FrameTiming )
    • m_nFrameIndex

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

      public int m_nNumFramePresents()
      number of times this frame was presented
    • m_nNumMisPresented

      public int m_nNumMisPresented()
      number of times this frame was presented on a vsync other than it was originally predicted to
    • m_nNumDroppedFrames

      public int m_nNumDroppedFrames()
      number of additional times previous frame was scanned out
    • m_nReprojectionFlags

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

      public double m_flSystemTimeInSeconds()
      Absolute time reference for comparing frames. This aligns with the vsync that running start is relative to.
    • m_flPreSubmitGpuMs

      public float m_flPreSubmitGpuMs()
      time spent rendering the scene (gpu work submitted between WaitGetPoses and second Submit)
    • m_flPostSubmitGpuMs

      public float m_flPostSubmitGpuMs()
      additional time spent rendering by application (e.g. companion window)
    • m_flTotalRenderGpuMs

      public float m_flTotalRenderGpuMs()
      time between work submitted immediately after present (ideally vsync) until the end of compositor submitted work
    • m_flCompositorRenderGpuMs

      public float m_flCompositorRenderGpuMs()
      time spend performing distortion correction, rendering chaperone, overlays, etc.
    • m_flCompositorRenderCpuMs

      public float m_flCompositorRenderCpuMs()
      time spent on cpu submitting the above work for this frame
    • m_flCompositorIdleCpuMs

      public float m_flCompositorIdleCpuMs()
      time spent waiting for running start (application could have used this much more time)
    • m_flClientFrameIntervalMs

      public float m_flClientFrameIntervalMs()
      time between calls to WaitGetPoses
    • m_flPresentCallCpuMs

      public float m_flPresentCallCpuMs()
      time blocked on call to present (usually 0.0, but can go long)
    • m_flWaitForPresentCpuMs

      public float m_flWaitForPresentCpuMs()
      time spent spin-waiting for frame index to change (not near-zero indicates wait object failure)
    • m_flSubmitFrameMs

      public float m_flSubmitFrameMs()
      time spent in Submit (not near-zero indicates driver issue)
    • 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()
      second call to Submit
    • 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_HmdPose

      public TrackedDevicePose m_HmdPose()
      pose used by app to render this frame
    • 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()
      Returns a new CompositorFrameTiming instance allocated with BufferUtils.
    • create

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static CompositorFrameTiming.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new CompositorFrameTiming.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
    • 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_HmdPose

      public static TrackedDevicePose nm_HmdPose(long struct)
      Unsafe version of m_HmdPose().
    • 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().