|
SBgl 0.1.0
A graphics framework in C99
|
SBgl provides a high-precision telemetry system designed to identify CPU and GPU bottlenecks in real-time. By utilizing hardware-native timing mechanisms, the system delivers ground-truth performance data with minimal execution overhead.
The telemetry system independently measures three primary components of the frame lifecycle:
vkCmdWriteTimestamp). To prevent CPU stalls, results are read back asynchronously from the previous frame.sbgl_BeginDrawing and sbgl_EndDrawing.sbgl_os_GetPerfCount).clock_gettime with CLOCK_MONOTONIC via the HAL.QueryPerformanceCounter via the HAL.timestampPeriod (nanoseconds per tick).Performance metrics are encapsulated in the sbgl_Telemetry structure:
Telemetry data for the previous frame is retrieved via the engine context. This asynchronous pattern ensures that the CPU never waits for the GPU to finish its work before starting the next frame's logic.
The telemetry data allows for clear identification of the limiting factor:
| Observation | Probable Bottleneck | Recommended Action |
|---|---|---|
High gpu_render_time | Fragment Shading / Fill-rate | Reduce render resolution or simplify shaders. |
High cpu_sort_time | Batcher Overhead | Optimize sorting keys or reduce total draw packets. |
Large cpu_frame_time difference | Driver / CPU Logic | Profile application-level update logic or driver submission. |
Planned extensions include Granular Profiling, which will enable timestamp markers for individual render queues and compute passes, allowing for deep-dive analysis of complex frame structures.