$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
gpu_profiler_ui.c File Reference
#include "gpu_profiler_ui.h"
#include "app_metrics.h"
#include "ui.h"
#include "utils.h"
#include <math.h>
#include <string.h>
Include dependency graph for gpu_profiler_ui.c:

Enumerations

enum  { TIME_BUF_SIZE = 32 }
 

Functions

static void hex_to_vec3 (uint32_t color, vec3 out)
 
static void gpu_profiler_ui_update_visibility (GPUProfilerUI *profiler_ui, float alpha_step)
 
static void gpu_stage_move (GPUStage *dest, GPUStage *src)
 Safely moves contents of one stage to another, avoiding shallow copies of heap-allocated buffers in AdaptiveSamplers. More...
 
static void gpu_profiler_ui_compact_stages (GPUProfilerUI *profiler_ui)
 
static void gpu_profiler_ui_sync_stage (GPUProfilerUI *profiler_ui, const GPUStage *live_stage, bool *display_updated)
 
void gpu_profiler_ui_init (GPUProfilerUI *profiler_ui)
 Initializes the GPU timeline UI state. More...
 
void gpu_profiler_ui_update (GPUProfilerUI *profiler_ui, GPUProfiler *live_profiler, double delta_time, double current_time, bool should_log_metrics)
 Updates animations and synchronizes data with the live profiler. More...
 
void gpu_profiler_ui_draw (GPUProfilerUI *profiler_ui, UIContext *ctx, int screen_width, int screen_height)
 Renders the GPU timeline using the provided UI context. More...
 
void gpu_profiler_ui_toggle_visibility (GPUProfilerUI *profiler_ui)
 Toggles the timeline visibility (with animation). More...
 
void gpu_profiler_ui_toggle_position (GPUProfilerUI *profiler_ui)
 Toggles the timeline position (Top/Bottom). More...
 
void gpu_profiler_ui_cleanup (GPUProfilerUI *profiler_ui)
 Cleans up GPU resources used by the UI. More...
 

Variables

static const float GRAPH_FONT_SIZE = 20.0F
 
static const float ROW_PAD = 3.0F
 
static const float BG_ALPHA = 0.85F
 
static const float PAD_SIDE = 20.0F
 
static const float GRAPH_WIDTH_RATIO = 0.65F
 
static const float TEXT_GAP = 20.0F
 
static const float MARGIN_Y = 60.0F
 
static const float BG_RADIUS = 8.0F
 
static const float BG_PAD = 5.0F
 
static const float BG_WIDTH_EXT = 10.0F
 
static const float BG_RGB_VAL = 0.05F
 
static const float FADE_EPSILON = 0.001F
 
static const float VISIBILITY_THRESHOLD = 0.5F
 
static const float MIN_VISIBLE_ALPHA_GLOBAL = 0.001F
 
static const float MIN_MS = 0.001F
 
static const float MIN_BAR_WIDTH = 1.0F
 
static const float BAR_RADIUS_FACTOR = 0.5F
 
static const float ROW_PAD_DOUBLE = 2.0F
 
static const float INDENT_STEP = 15.0F
 
static const float TEXT_Y_OFFSET = -5.0F
 
static const float TEXT_SHADOW_OFFSET = 1.0F
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TIME_BUF_SIZE 

Function Documentation

◆ gpu_profiler_ui_cleanup()

void gpu_profiler_ui_cleanup ( GPUProfilerUI profiler_ui)

Cleans up GPU resources used by the UI.

Here is the call graph for this function:

◆ gpu_profiler_ui_compact_stages()

static void gpu_profiler_ui_compact_stages ( GPUProfilerUI profiler_ui)
static
Here is the call graph for this function:

◆ gpu_profiler_ui_draw()

void gpu_profiler_ui_draw ( GPUProfilerUI profiler_ui,
UIContext ctx,
int  screen_width,
int  screen_height 
)

Renders the GPU timeline using the provided UI context.

Here is the call graph for this function:

◆ gpu_profiler_ui_init()

void gpu_profiler_ui_init ( GPUProfilerUI profiler_ui)

Initializes the GPU timeline UI state.

Here is the call graph for this function:

◆ gpu_profiler_ui_sync_stage()

static void gpu_profiler_ui_sync_stage ( GPUProfilerUI profiler_ui,
const GPUStage live_stage,
bool *  display_updated 
)
static
Here is the call graph for this function:

◆ gpu_profiler_ui_toggle_position()

void gpu_profiler_ui_toggle_position ( GPUProfilerUI profiler_ui)

Toggles the timeline position (Top/Bottom).

◆ gpu_profiler_ui_toggle_visibility()

void gpu_profiler_ui_toggle_visibility ( GPUProfilerUI profiler_ui)

Toggles the timeline visibility (with animation).

◆ gpu_profiler_ui_update()

void gpu_profiler_ui_update ( GPUProfilerUI profiler_ui,
GPUProfiler live_profiler,
double  delta_time,
double  current_time,
bool  should_log_metrics 
)

Updates animations and synchronizes data with the live profiler.

Here is the call graph for this function:

◆ gpu_profiler_ui_update_visibility()

static void gpu_profiler_ui_update_visibility ( GPUProfilerUI profiler_ui,
float  alpha_step 
)
static

◆ gpu_stage_move()

static void gpu_stage_move ( GPUStage dest,
GPUStage src 
)
static

Safely moves contents of one stage to another, avoiding shallow copies of heap-allocated buffers in AdaptiveSamplers.

Here is the call graph for this function:

◆ hex_to_vec3()

static void hex_to_vec3 ( uint32_t  color,
vec3  out 
)
static

Variable Documentation

◆ BAR_RADIUS_FACTOR

const float BAR_RADIUS_FACTOR = 0.5F
static

◆ BG_ALPHA

const float BG_ALPHA = 0.85F
static

◆ BG_PAD

const float BG_PAD = 5.0F
static

◆ BG_RADIUS

const float BG_RADIUS = 8.0F
static

◆ BG_RGB_VAL

const float BG_RGB_VAL = 0.05F
static

◆ BG_WIDTH_EXT

const float BG_WIDTH_EXT = 10.0F
static

◆ FADE_EPSILON

const float FADE_EPSILON = 0.001F
static

◆ GRAPH_FONT_SIZE

const float GRAPH_FONT_SIZE = 20.0F
static

◆ GRAPH_WIDTH_RATIO

const float GRAPH_WIDTH_RATIO = 0.65F
static

◆ INDENT_STEP

const float INDENT_STEP = 15.0F
static

◆ MARGIN_Y

const float MARGIN_Y = 60.0F
static

◆ MIN_BAR_WIDTH

const float MIN_BAR_WIDTH = 1.0F
static

◆ MIN_MS

const float MIN_MS = 0.001F
static

◆ MIN_VISIBLE_ALPHA_GLOBAL

const float MIN_VISIBLE_ALPHA_GLOBAL = 0.001F
static

◆ PAD_SIDE

const float PAD_SIDE = 20.0F
static

◆ ROW_PAD

const float ROW_PAD = 3.0F
static

◆ ROW_PAD_DOUBLE

const float ROW_PAD_DOUBLE = 2.0F
static

◆ TEXT_GAP

const float TEXT_GAP = 20.0F
static

◆ TEXT_SHADOW_OFFSET

const float TEXT_SHADOW_OFFSET = 1.0F
static

◆ TEXT_Y_OFFSET

const float TEXT_Y_OFFSET = -5.0F
static

◆ VISIBILITY_THRESHOLD

const float VISIBILITY_THRESHOLD = 0.5F
static