$darkmode
Automated A/B GPU cost measurement for postprocess effects. More...
Data Structures | |
| struct | EffectEntry |
Macros | |
| #define | BENCH_TAG "suckless-ogl.bench" |
| #define | MS_PER_SEC 1000.0F |
Functions | |
| static float | find_composite_duration (const GPUProfiler *profiler) |
| Find the "Final Composite" stage in the profiler and return its raw duration_ms, or -1.0 if not found. More... | |
| static void | reset_accumulator (EffectBenchmark *bench) |
| static void | apply_effects (EffectBenchmark *bench, unsigned int effects) |
| Atomically apply a new effect bitmask. More... | |
| static void | compute_stats (const EffectBenchmark *bench, float *out_mean, float *out_stddev) |
| void | effect_benchmark_init (EffectBenchmark *bench, PostProcess *postprocess, GPUProfiler *profiler) |
| Initializes the benchmark (call once at startup). More... | |
| bool | effect_benchmark_start (EffectBenchmark *bench) |
| Starts a new benchmark sweep. More... | |
| bool | effect_benchmark_is_running (const EffectBenchmark *bench) |
| Returns true if a benchmark is currently running. More... | |
| bool | effect_benchmark_update (EffectBenchmark *bench) |
| Per-frame update. Call after gpu_profiler_begin_frame(). More... | |
| void | effect_benchmark_log_results (const EffectBenchmark *bench) |
| Logs all results to the console via LOG_INFO. More... | |
Variables | |
| static const unsigned int | DEBUG_VIEW_BITS |
| static const EffectEntry | BENCHMARKABLE_EFFECTS [] |
| static const int | BENCHMARKABLE_COUNT |
Automated A/B GPU cost measurement for postprocess effects.
State machine that cycles through effects, measuring "Final Composite" GPU time with each effect disabled vs baseline (all ON).
| #define BENCH_TAG "suckless-ogl.bench" |
| #define MS_PER_SEC 1000.0F |
|
static |
Atomically apply a new effect bitmask.
Sets active_effects, marks the UBO dirty, AND recompiles the uber-shader if running in optimized mode (release builds bake effect toggles as compile-time #defines — without recompilation the shader ignores the UBO activeEffects field).
|
static |
| void effect_benchmark_init | ( | EffectBenchmark * | bench, |
| PostProcess * | postprocess, | ||
| GPUProfiler * | profiler | ||
| ) |
Initializes the benchmark (call once at startup).
| bool effect_benchmark_is_running | ( | const EffectBenchmark * | bench | ) |
Returns true if a benchmark is currently running.
| void effect_benchmark_log_results | ( | const EffectBenchmark * | bench | ) |
Logs all results to the console via LOG_INFO.
| bool effect_benchmark_start | ( | EffectBenchmark * | bench | ) |
Starts a new benchmark sweep.
| bool effect_benchmark_update | ( | EffectBenchmark * | bench | ) |
Per-frame update. Call after gpu_profiler_begin_frame().
Reads the "Final Composite" timing from the profiler, advances the state machine, and toggles effects as needed.
|
static |
Find the "Final Composite" stage in the profiler and return its raw duration_ms, or -1.0 if not found.
|
static |
|
static |
|
static |
|
static |
All toggleable effects executed in the "Final Composite" fullscreen pass (postprocess.frag). This includes multi-pass effects like Bloom, DoF, and Motion Blur whose setup runs in separate profiler stages but whose final compositing/sampling cost is paid here.
Order follows the pipeline stages in postprocess.frag main().