Class BGFXStats

  • All Implemented Interfaces:
    Pointer

    public class BGFXStats
    extends Struct
    Renderer statistics data.

    All time values are high-resolution timestamps, while time frequencies define timestamps-per-second for that hardware.

    Member documentation

    • cpuTimeFrame – CPU time between two frame calls
    • cpuTimeBegin – Render thread CPU submit begin time
    • cpuTimeEnd – Render thread CPU submit end time
    • cpuTimerFreq – CPU timer frequency. Timestamps-per-second.
    • gpuTimeBegin – GPU frame begin time
    • gpuTimeEnd – GPU frame end time
    • gpuTimerFreq – GPU timer frequency
    • waitRender – time spent waiting for render backend thread to finish issuing draw commands to underlying graphics API
    • waitSubmit – time spent waiting for submit thread to advance to next frame
    • numDraw – number of draw calls submitted
    • numCompute – number of compute calls submitted
    • maxGpuLatency – GPU driver latency
    • numDynamicIndexBuffers – number of used dynamic index buffers
    • numDynamicVertexBuffers – number of used dynamic vertex buffers
    • numFrameBuffers – number of used frame buffers
    • numIndexBuffers – number of used index buffers
    • numOcclusionQueries – number of used occlusion queries
    • numPrograms – number of used programs
    • numShaders – number of used shaders
    • numTextures – number of used textures
    • numUniforms – number of used uniforms
    • numVertexBuffers – number of used vertex buffers
    • numVertexDecls – number of used vertex declarations
    • textureMemoryUsed – estimate of texture memory used
    • rtMemoryUsed – estimate of render target memory used
    • transientVbUsed – amount of transient vertex buffer used
    • transientIbUsed – amount of transient index buffer used
    • numPrims – number of primitives rendered
    • gpuMemoryMax – maximum available GPU memory for application
    • gpuMemoryUsed – amount of GPU memory used by the application
    • width – backbuffer width in pixels
    • height – backbuffer height in pixels
    • textWidth – debug text width in characters
    • textHeight – debug text height in characters
    • numViews – number of view stats
    • viewStats – array of view stats
    • numEncoder – number of encoders used during frame
    • encoderStats – array of encoder stats

    Layout

    
     struct bgfx_stats_t {
         int64_t cpuTimeFrame;
         int64_t cpuTimeBegin;
         int64_t cpuTimeEnd;
         int64_t cpuTimerFreq;
         int64_t gpuTimeBegin;
         int64_t gpuTimeEnd;
         int64_t gpuTimerFreq;
         int64_t waitRender;
         int64_t waitSubmit;
         uint32_t numDraw;
         uint32_t numCompute;
         uint32_t maxGpuLatency;
         uint16_t numDynamicIndexBuffers;
         uint16_t numDynamicVertexBuffers;
         uint16_t numFrameBuffers;
         uint16_t numIndexBuffers;
         uint16_t numOcclusionQueries;
         uint16_t numPrograms;
         uint16_t numShaders;
         uint16_t numTextures;
         uint16_t numUniforms;
         uint16_t numVertexBuffers;
         uint16_t numVertexDecls;
         int64_t textureMemoryUsed;
         int64_t rtMemoryUsed;
         int32_t transientVbUsed;
         int32_t transientIbUsed;
         uint32_t numPrims[BGFX_TOPOLOGY_COUNT];
         int64_t gpuMemoryMax;
         int64_t gpuMemoryUsed;
         uint16_t width;
         uint16_t height;
         uint16_t textWidth;
         uint16_t textHeight;
         uint16_t numViews;
         bgfx_view_stats_t * viewStats;
         uint16_t numEncoder;
         bgfx_encoder_stats_t * encoderStats;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • CPUTIMEFRAME, CPUTIMEBEGIN, CPUTIMEEND, CPUTIMERFREQ, GPUTIMEBEGIN, GPUTIMEEND, GPUTIMERFREQ, WAITRENDER, WAITSUBMIT, NUMDRAW, NUMCOMPUTE, MAXGPULATENCY, NUMDYNAMICINDEXBUFFERS, NUMDYNAMICVERTEXBUFFERS, NUMFRAMEBUFFERS, NUMINDEXBUFFERS, NUMOCCLUSIONQUERIES, NUMPROGRAMS, NUMSHADERS, NUMTEXTURES, NUMUNIFORMS, NUMVERTEXBUFFERS, NUMVERTEXDECLS, TEXTUREMEMORYUSED, RTMEMORYUSED, TRANSIENTVBUSED, TRANSIENTIBUSED, NUMPRIMS, GPUMEMORYMAX, GPUMEMORYUSED, WIDTH, HEIGHT, TEXTWIDTH, TEXTHEIGHT, NUMVIEWS, VIEWSTATS, NUMENCODER, ENCODERSTATS

        The struct member offsets.
    • Constructor Detail

      • BGFXStats

        public BGFXStats​(java.nio.ByteBuffer container)
        Creates a BGFXStats 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
      • cpuTimeFrame

        public long cpuTimeFrame()
        Returns the value of the cpuTimeFrame field.
      • cpuTimeBegin

        public long cpuTimeBegin()
        Returns the value of the cpuTimeBegin field.
      • cpuTimeEnd

        public long cpuTimeEnd()
        Returns the value of the cpuTimeEnd field.
      • cpuTimerFreq

        public long cpuTimerFreq()
        Returns the value of the cpuTimerFreq field.
      • gpuTimeBegin

        public long gpuTimeBegin()
        Returns the value of the gpuTimeBegin field.
      • gpuTimeEnd

        public long gpuTimeEnd()
        Returns the value of the gpuTimeEnd field.
      • gpuTimerFreq

        public long gpuTimerFreq()
        Returns the value of the gpuTimerFreq field.
      • waitRender

        public long waitRender()
        Returns the value of the waitRender field.
      • waitSubmit

        public long waitSubmit()
        Returns the value of the waitSubmit field.
      • numDraw

        public int numDraw()
        Returns the value of the numDraw field.
      • numCompute

        public int numCompute()
        Returns the value of the numCompute field.
      • maxGpuLatency

        public int maxGpuLatency()
        Returns the value of the maxGpuLatency field.
      • numDynamicIndexBuffers

        public short numDynamicIndexBuffers()
        Returns the value of the numDynamicIndexBuffers field.
      • numDynamicVertexBuffers

        public short numDynamicVertexBuffers()
        Returns the value of the numDynamicVertexBuffers field.
      • numFrameBuffers

        public short numFrameBuffers()
        Returns the value of the numFrameBuffers field.
      • numIndexBuffers

        public short numIndexBuffers()
        Returns the value of the numIndexBuffers field.
      • numOcclusionQueries

        public short numOcclusionQueries()
        Returns the value of the numOcclusionQueries field.
      • numPrograms

        public short numPrograms()
        Returns the value of the numPrograms field.
      • numShaders

        public short numShaders()
        Returns the value of the numShaders field.
      • numTextures

        public short numTextures()
        Returns the value of the numTextures field.
      • numUniforms

        public short numUniforms()
        Returns the value of the numUniforms field.
      • numVertexBuffers

        public short numVertexBuffers()
        Returns the value of the numVertexBuffers field.
      • numVertexDecls

        public short numVertexDecls()
        Returns the value of the numVertexDecls field.
      • textureMemoryUsed

        public long textureMemoryUsed()
        Returns the value of the textureMemoryUsed field.
      • rtMemoryUsed

        public long rtMemoryUsed()
        Returns the value of the rtMemoryUsed field.
      • transientVbUsed

        public int transientVbUsed()
        Returns the value of the transientVbUsed field.
      • transientIbUsed

        public int transientIbUsed()
        Returns the value of the transientIbUsed field.
      • numPrims

        public java.nio.IntBuffer numPrims()
        Returns a IntBuffer view of the numPrims field.
      • numPrims

        public int numPrims​(int index)
        Returns the value at the specified index of the numPrims field.
      • gpuMemoryMax

        public long gpuMemoryMax()
        Returns the value of the gpuMemoryMax field.
      • gpuMemoryUsed

        public long gpuMemoryUsed()
        Returns the value of the gpuMemoryUsed field.
      • width

        public short width()
        Returns the value of the width field.
      • height

        public short height()
        Returns the value of the height field.
      • textWidth

        public short textWidth()
        Returns the value of the textWidth field.
      • textHeight

        public short textHeight()
        Returns the value of the textHeight field.
      • numViews

        public short numViews()
        Returns the value of the numViews field.
      • numEncoder

        public short numEncoder()
        Returns the value of the numEncoder field.
      • create

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

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

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

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

        public static long ncpuTimeFrame​(long struct)
        Unsafe version of cpuTimeFrame().
      • ncpuTimeBegin

        public static long ncpuTimeBegin​(long struct)
        Unsafe version of cpuTimeBegin().
      • ncpuTimeEnd

        public static long ncpuTimeEnd​(long struct)
        Unsafe version of cpuTimeEnd().
      • ncpuTimerFreq

        public static long ncpuTimerFreq​(long struct)
        Unsafe version of cpuTimerFreq().
      • ngpuTimeBegin

        public static long ngpuTimeBegin​(long struct)
        Unsafe version of gpuTimeBegin().
      • ngpuTimeEnd

        public static long ngpuTimeEnd​(long struct)
        Unsafe version of gpuTimeEnd().
      • ngpuTimerFreq

        public static long ngpuTimerFreq​(long struct)
        Unsafe version of gpuTimerFreq().
      • nwaitRender

        public static long nwaitRender​(long struct)
        Unsafe version of waitRender().
      • nwaitSubmit

        public static long nwaitSubmit​(long struct)
        Unsafe version of waitSubmit().
      • nnumDraw

        public static int nnumDraw​(long struct)
        Unsafe version of numDraw().
      • nnumCompute

        public static int nnumCompute​(long struct)
        Unsafe version of numCompute().
      • nmaxGpuLatency

        public static int nmaxGpuLatency​(long struct)
        Unsafe version of maxGpuLatency().
      • nnumDynamicIndexBuffers

        public static short nnumDynamicIndexBuffers​(long struct)
        Unsafe version of numDynamicIndexBuffers().
      • nnumDynamicVertexBuffers

        public static short nnumDynamicVertexBuffers​(long struct)
        Unsafe version of numDynamicVertexBuffers().
      • nnumFrameBuffers

        public static short nnumFrameBuffers​(long struct)
        Unsafe version of numFrameBuffers().
      • nnumIndexBuffers

        public static short nnumIndexBuffers​(long struct)
        Unsafe version of numIndexBuffers().
      • nnumOcclusionQueries

        public static short nnumOcclusionQueries​(long struct)
        Unsafe version of numOcclusionQueries().
      • nnumPrograms

        public static short nnumPrograms​(long struct)
        Unsafe version of numPrograms().
      • nnumShaders

        public static short nnumShaders​(long struct)
        Unsafe version of numShaders().
      • nnumTextures

        public static short nnumTextures​(long struct)
        Unsafe version of numTextures().
      • nnumUniforms

        public static short nnumUniforms​(long struct)
        Unsafe version of numUniforms().
      • nnumVertexBuffers

        public static short nnumVertexBuffers​(long struct)
        Unsafe version of numVertexBuffers().
      • nnumVertexDecls

        public static short nnumVertexDecls​(long struct)
        Unsafe version of numVertexDecls().
      • ntextureMemoryUsed

        public static long ntextureMemoryUsed​(long struct)
        Unsafe version of textureMemoryUsed().
      • nrtMemoryUsed

        public static long nrtMemoryUsed​(long struct)
        Unsafe version of rtMemoryUsed().
      • ntransientVbUsed

        public static int ntransientVbUsed​(long struct)
        Unsafe version of transientVbUsed().
      • ntransientIbUsed

        public static int ntransientIbUsed​(long struct)
        Unsafe version of transientIbUsed().
      • nnumPrims

        public static java.nio.IntBuffer nnumPrims​(long struct)
        Unsafe version of numPrims().
      • nnumPrims

        public static int nnumPrims​(long struct,
                                    int index)
        Unsafe version of numPrims.
      • ngpuMemoryMax

        public static long ngpuMemoryMax​(long struct)
        Unsafe version of gpuMemoryMax().
      • ngpuMemoryUsed

        public static long ngpuMemoryUsed​(long struct)
        Unsafe version of gpuMemoryUsed().
      • nwidth

        public static short nwidth​(long struct)
        Unsafe version of width().
      • nheight

        public static short nheight​(long struct)
        Unsafe version of height().
      • ntextWidth

        public static short ntextWidth​(long struct)
        Unsafe version of textWidth().
      • ntextHeight

        public static short ntextHeight​(long struct)
        Unsafe version of textHeight().
      • nnumViews

        public static short nnumViews​(long struct)
        Unsafe version of numViews().
      • nnumEncoder

        public static short nnumEncoder​(long struct)
        Unsafe version of numEncoder().