$darkmode
Automated A/B GPU cost measurement for individual postprocess effects. More...
Go to the source code of this file.
Data Structures | |
| struct | EffectBenchResult |
| Timing result for a single effect. More... | |
| struct | EffectBenchmark |
| State for the automated benchmark sweep. More... | |
Macros | |
| #define | BENCH_MEASURE_FRAMES 120 |
| Number of frames to measure per phase (warmup excluded). More... | |
| #define | BENCH_WARMUP_FRAMES 30 |
| Frames to skip at the start of each phase (cache warmup). More... | |
| #define | BENCH_MAX_EFFECTS 16 |
| Maximum number of effects that can be benchmarked. More... | |
| #define | BENCH_TIMEOUT_MS 2000.0F |
| Timeout in milliseconds to abort benchmark if no profiler data. More... | |
Enumerations | |
| enum | BenchPhase { BENCH_IDLE = 0 , BENCH_BASELINE , BENCH_STABILIZE , BENCH_EFFECT_TEST , BENCH_DONE } |
| State machine phases for the benchmark sweep. More... | |
Functions | |
| 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_update (EffectBenchmark *bench) |
| Per-frame update. Call after gpu_profiler_begin_frame(). More... | |
| bool | effect_benchmark_is_running (const EffectBenchmark *bench) |
| Returns true if a benchmark is currently running. More... | |
| void | effect_benchmark_log_results (const EffectBenchmark *bench) |
| Logs all results to the console via LOG_INFO. More... | |
Automated A/B GPU cost measurement for individual postprocess effects.
Cycles through each toggleable postprocess effect, disabling it one at a time while measuring the "Final Composite" GPU timer. The difference between the baseline (all effects ON) and each disabled-effect run gives the per-effect GPU cost.
Usage:
| #define BENCH_MAX_EFFECTS 16 |
Maximum number of effects that can be benchmarked.
| #define BENCH_MEASURE_FRAMES 120 |
Number of frames to measure per phase (warmup excluded).
| #define BENCH_TIMEOUT_MS 2000.0F |
Timeout in milliseconds to abort benchmark if no profiler data.
| #define BENCH_WARMUP_FRAMES 30 |
Frames to skip at the start of each phase (cache warmup).
| enum BenchPhase |
State machine phases for the benchmark sweep.
| 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.