From e9b096574d08cb6b5a568af467485b6419e9d79b Mon Sep 17 00:00:00 2001 From: jfpaardoo Date: Thu, 26 Nov 2026 19:38:19 +0100 Subject: [PATCH 1/6] ui: add built-in in-game benchmark --- Makefile | 9 + runtime/benchmark.c | 728 ++++++++++++++++++++++++++++++++++++ runtime/benchmark.h | 118 ++++++ runtime/control.c | 6 + runtime/control_input.c | 12 +- runtime/ui/benchmark_ui.h | 13 + runtime/ui/benchmark_ui.mm | 323 ++++++++++++++++ runtime/ui/i18n/de.inc | 59 +++ runtime/ui/i18n/es.inc | 59 +++ runtime/ui/i18n/fr.inc | 59 +++ runtime/ui/i18n/he.inc | 59 +++ runtime/ui/i18n/it.inc | 59 +++ runtime/ui/i18n/ja.inc | 59 +++ runtime/ui/i18n/ko.inc | 59 +++ runtime/ui/i18n/nl.inc | 59 +++ runtime/ui/i18n/pt.inc | 59 +++ runtime/ui/i18n/ru.inc | 59 +++ runtime/ui/i18n/th.inc | 59 +++ runtime/ui/i18n/zh-Hans.inc | 59 +++ runtime/ui/i18n/zh-Hant.inc | 59 +++ runtime/ui/menu.mm | 19 +- tests/test_benchmark.c | 103 +++++ 22 files changed, 2095 insertions(+), 3 deletions(-) create mode 100644 runtime/benchmark.c create mode 100644 runtime/benchmark.h create mode 100644 runtime/ui/benchmark_ui.h create mode 100644 runtime/ui/benchmark_ui.mm create mode 100644 tests/test_benchmark.c diff --git a/Makefile b/Makefile index db3683de0..2b1232b21 100644 --- a/Makefile +++ b/Makefile @@ -619,6 +619,15 @@ test-output-scale: $(B)/test_output_scale .PHONY: test-output-scale +$(B)/test_benchmark: tests/test_benchmark.c runtime/benchmark.c runtime/benchmark.h + @mkdir -p $(B) + $(CC) -O1 $(OSFLAGS) -Iruntime -o $@ $< -lm + +test-benchmark: $(B)/test_benchmark + $(B)/test_benchmark + +.PHONY: test-benchmark + $(B)/test_window_size: tests/test_window_size.c runtime/window_size.c $(RT_HDRS) @mkdir -p $(B) $(CC) -O1 -DSDL_STATIC_LIB $(OSFLAGS) $(DEPINC) -Iruntime -o $@ tests/test_window_size.c runtime/window_size.c -lSDL3 -lpthread -lm diff --git a/runtime/benchmark.c b/runtime/benchmark.c new file mode 100644 index 000000000..8f42a63f2 --- /dev/null +++ b/runtime/benchmark.c @@ -0,0 +1,728 @@ +// Built-in fixed-view performance benchmark (runtime/benchmark.h, runtime/ui/benchmark_ui.mm). +#include "benchmark.h" + +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +#include +#else +#include +#endif + +static const BenchRouteInfo k_routes[BENCH_ROUTE_COUNT] = { + {"plateau", "Great Plateau", -1041.6f, 250.2f, 1812.1f, 150.0, -3.0, 10.0f, false}, + {"kakariko", "Kakariko Village", 1811.7f, 218.5f, 982.6f, 180.0, -10.0, 10.0f, false}, + {"field", "Hyrule Field", 384.8f, 121.7f, 1035.6f, 180.0, -3.0, 10.0f, false}, + {"rito", "Rito Village", -3610.0f, 300.0f, -1730.0f, 180.0, -8.0, 10.0f, true}, + {"castle", "Hyrule Castle", -254.0f, 260.0f, -400.0f, 180.0, 0.0, 10.0f, true}, + {"hateno", "Hateno Village", 3437.5f, 235.9f, 2101.5f, 90.0, -8.0, 10.0f, false}, + {"korok", "Korok Forest", 462.6f, 249.6f, -2110.1f, 0.0, -8.0, 10.0f, false}, +}; + +int bench_route_count(void) { return BENCH_ROUTE_COUNT; } + +const BenchRouteInfo *bench_route_info(int i) { + return (i >= 0 && i < BENCH_ROUTE_COUNT) ? &k_routes[i] : NULL; +} + +static int cmp_u32(const void *a, const void *b) { + uint32_t va = *(const uint32_t *)a, vb = *(const uint32_t *)b; + return (va > vb) - (va < vb); +} + +static double sorted_percentile_ms(const uint32_t *s, uint32_t n, double p) { + if (!n) return 0.0; + double idx = p * (double)(n - 1); + uint32_t lo = (uint32_t)idx, hi = lo + 1 < n ? lo + 1 : lo; + double frac = idx - (double)lo; + return ((double)s[lo] * (1.0 - frac) + (double)s[hi] * frac) / 1000.0; +} + +static double top_tail_fps(const uint32_t *s, uint32_t n, double frac) { + if (!n) return 0.0; + uint32_t k = (uint32_t)ceil((double)n * frac); + if (k < 1) k = 1; + if (k > n) k = n; + uint64_t sum = 0; + for (uint32_t i = n - k; i < n; i++) sum += s[i]; + double mean_ms = (double)sum / ((double)k * 1000.0); + return mean_ms > 0.0 ? 1000.0 / mean_ms : 0.0; +} + +void bench_compute_stats(const uint32_t *frame_us, uint32_t count, double duration_s, BenchRouteStats *out) { + if (!out) return; + char saved_id[32], saved_name[64]; + memcpy(saved_id, out->id, sizeof saved_id); + memcpy(saved_name, out->name, sizeof saved_name); + float vram = out->vram_peak_mb, ram = out->ram_peak_mb; + float gload = out->gpu_load_avg, gtemp = out->gpu_temp_peak, gclk = out->gpu_clock_avg; + memset(out, 0, sizeof *out); + memcpy(out->id, saved_id, sizeof out->id); + memcpy(out->name, saved_name, sizeof out->name); + out->vram_peak_mb = vram; + out->ram_peak_mb = ram; + out->gpu_load_avg = gload; + out->gpu_temp_peak = gtemp; + out->gpu_clock_avg = gclk; + + if (!frame_us || count == 0) { + out->failed = true; + snprintf(out->fail_reason, sizeof out->fail_reason, "No frames recorded"); + return; + } + uint32_t *s = (uint32_t *)malloc((size_t)count * sizeof *s); + if (!s) { + out->failed = true; + snprintf(out->fail_reason, sizeof out->fail_reason, "Out of memory"); + return; + } + uint64_t sum_us = 0; + for (uint32_t i = 0; i < count; i++) { + s[i] = frame_us[i]; + sum_us += frame_us[i]; + } + qsort(s, count, sizeof *s, cmp_u32); + + out->valid = true; + out->frames = count; + double elapsed_s = duration_s > 0.0 ? duration_s : (double)sum_us / 1000000.0; + out->duration_s = elapsed_s; + out->avg_ms = (double)sum_us / ((double)count * 1000.0); + out->avg_fps = elapsed_s > 0.0 ? (double)count / elapsed_s : (out->avg_ms > 0.0 ? 1000.0 / out->avg_ms : 0.0); + out->min_ms = (double)s[0] / 1000.0; + out->max_ms = (double)s[count - 1] / 1000.0; + out->median_ms = sorted_percentile_ms(s, count, 0.50); + out->p95_ms = sorted_percentile_ms(s, count, 0.95); + out->p99_ms = sorted_percentile_ms(s, count, 0.99); + out->low_1pct_fps = top_tail_fps(s, count, 0.01); + out->low_01pct_fps = top_tail_fps(s, count, 0.001); + + uint32_t hitches = 0; + double thresh = out->median_ms * 2.0; + if (thresh < 33.333) thresh = 33.333; + for (uint32_t i = 0; i < count; i++) { + double ms = (double)frame_us[i] / 1000.0; + if (ms > thresh) hitches++; + } + out->hitches = hitches; + free(s); + + // Downsample raw frame times into BENCH_SPARK_LEN buckets keeping the bucket max so spikes stay visible. + int nbins = count < BENCH_SPARK_LEN ? (int)count : BENCH_SPARK_LEN; + out->spark_n = nbins; + for (int b = 0; b < nbins; b++) { + uint32_t start = (uint32_t)(((uint64_t)b * count) / (uint64_t)nbins); + uint32_t end = (uint32_t)(((uint64_t)(b + 1) * count) / (uint64_t)nbins); + if (end <= start) end = start + 1; + uint32_t peak = 0; + for (uint32_t j = start; j < end && j < count; j++) + if (frame_us[j] > peak) peak = frame_us[j]; + out->spark_ms[b] = (float)peak / 1000.0f; + } +} + +static size_t appendf(char *buf, size_t cap, size_t off, const char *fmt, ...) { + if (!buf || off >= cap) return off; + va_list ap; + va_start(ap, fmt); + int n = vsnprintf(buf + off, cap - off, fmt, ap); + va_end(ap); + if (n <= 0) return off; + size_t add = (size_t)n; + return off + add < cap ? off + add : cap - 1; +} + +size_t bench_format_markdown(const BenchSnapshot *snap, char *buf, size_t n) { + if (!snap || !buf || !n) return 0; + buf[0] = 0; + size_t o = 0; + o = appendf(buf, n, o, "## Savage Wind Benchmark\n\n"); + if (snap->gpu_name[0]) o = appendf(buf, n, o, "- **GPU**: %s\n", snap->gpu_name); + if (snap->cpu_name[0]) o = appendf(buf, n, o, "- **CPU**: %s\n", snap->cpu_name); + if (snap->width > 0 && snap->height > 0) o = appendf(buf, n, o, "- **Resolution**: %d x %d\n", snap->width, snap->height); + if (snap->settings_summary[0]) o = appendf(buf, n, o, "- **Settings**: %s\n", snap->settings_summary); + o = appendf(buf, n, o, "\n| Route | Avg FPS | 1%% Low | 0.1%% Low | Avg ms | p99 ms | Max ms | Hitches | VRAM MB |\n"); + o = appendf(buf, n, o, "|---|---:|---:|---:|---:|---:|---:|---:|---:|\n"); + for (int i = 0; i < snap->nresults && i < BENCH_MAX_RESULTS; i++) { + const BenchRouteStats *r = &snap->results[i]; + if (!r->valid) { + o = appendf(buf, n, o, "| %s | FAILED | - | - | - | - | - | - | - |\n", r->name[0] ? r->name : r->id); + continue; + } + char vram[24] = "-"; + if (r->vram_peak_mb > 0) snprintf(vram, sizeof vram, "%.0f", r->vram_peak_mb); + o = appendf(buf, n, o, "| %s | %.1f | %.1f | %.1f | %.2f | %.2f | %.1f | %u | %s |\n", + r->name, r->avg_fps, r->low_1pct_fps, r->low_01pct_fps, r->avg_ms, r->p99_ms, r->max_ms, r->hitches, vram); + } + if (snap->overall.valid) { + const BenchRouteStats *r = &snap->overall; + char vram[24] = "-"; + if (r->vram_peak_mb > 0) snprintf(vram, sizeof vram, "%.0f", r->vram_peak_mb); + o = appendf(buf, n, o, "| **Overall** | **%.1f** | **%.1f** | **%.1f** | **%.2f** | **%.2f** | **%.1f** | **%u** | **%s** |\n", + r->avg_fps, r->low_1pct_fps, r->low_01pct_fps, r->avg_ms, r->p99_ms, r->max_ms, r->hitches, vram); + } + return o; +} + +#ifndef BENCH_STATS_ONLY +#include +#include "control.h" +#include "hle.h" +#include "nvn/output_scale.h" +#include "paths.h" +#include "perfmon.h" +#include "rt.h" +#include "settings.h" + +extern bool control_fly_set(bool want); +extern bool control_look_start(bool use_yaw, double yaw, bool use_pitch, double pitch, int settle); +extern bool control_look_active(void); +extern float test_warp_hour(bool *held); +extern void test_warp_set_hour(float hour); +extern void test_warp_hold_hour(float hour); +extern void menu_open_page(int id); +#ifndef SW_METAL +extern void renderer_get_scale(float *sx, float *sy); +#endif +#endif + +static void make_dir(const char *p) { +#ifdef _WIN32 + _mkdir(p); +#else + mkdir(p, 0755); +#endif +} + +static void csv_escape(FILE *f, const char *s) { + fputc('"', f); + for (; s && *s; s++) { + if (*s == '"') fputc('"', f); + fputc(*s, f); + } + fputc('"', f); +} + +bool bench_save_csv(const BenchSnapshot *snap, char *out_path, size_t out_path_n) { + if (!snap || !snap->has_results) return false; +#ifdef BENCH_STATS_ONLY + const char *root = "."; +#else + const char *root = rt_data_root(); + if (!root || !root[0]) root = "."; +#endif + char dir[512]; + snprintf(dir, sizeof dir, "%s/benchmarks", root); + make_dir(dir); + + time_t now = time(NULL); + struct tm tmbuf; +#ifdef _WIN32 + localtime_s(&tmbuf, &now); +#else + localtime_r(&now, &tmbuf); +#endif + char path[600]; + snprintf(path, sizeof path, "%s/benchmark_%04d%02d%02d_%02d%02d%02d.csv", + dir, tmbuf.tm_year + 1900, tmbuf.tm_mon + 1, tmbuf.tm_mday, + tmbuf.tm_hour, tmbuf.tm_min, tmbuf.tm_sec); + FILE *f = fopen(path, "w"); + if (!f) return false; + + fprintf(f, "route_id,route_name,valid,frames,duration_s,avg_fps,low_1pct_fps,low_01pct_fps,avg_ms,median_ms,p95_ms,p99_ms,min_ms,max_ms,hitches,vram_peak_mb,ram_peak_mb,gpu_load_avg,gpu_temp_peak,gpu_clock_avg,gpu,width,height,settings\n"); + for (int i = 0; i < snap->nresults && i < BENCH_MAX_RESULTS; i++) { + const BenchRouteStats *r = &snap->results[i]; + csv_escape(f, r->id); fputc(',', f); + csv_escape(f, r->name); fputc(',', f); + fprintf(f, "%d,%u,%.3f,%.2f,%.2f,%.2f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%u,%.1f,%.1f,%.1f,%.1f,%.1f,", + r->valid ? 1 : 0, r->frames, r->duration_s, + r->avg_fps, r->low_1pct_fps, r->low_01pct_fps, + r->avg_ms, r->median_ms, r->p95_ms, r->p99_ms, r->min_ms, r->max_ms, r->hitches, + r->vram_peak_mb, r->ram_peak_mb, r->gpu_load_avg, r->gpu_temp_peak, r->gpu_clock_avg); + csv_escape(f, snap->gpu_name); fputc(',', f); + fprintf(f, "%d,%d,", snap->width, snap->height); + csv_escape(f, snap->settings_summary); fputc('\n', f); + } + if (snap->overall.valid) { + const BenchRouteStats *r = &snap->overall; + fprintf(f, "overall,Overall,1,%u,%.3f,%.2f,%.2f,%.2f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%u,%.1f,%.1f,%.1f,%.1f,%.1f,", + r->frames, r->duration_s, + r->avg_fps, r->low_1pct_fps, r->low_01pct_fps, + r->avg_ms, r->median_ms, r->p95_ms, r->p99_ms, r->min_ms, r->max_ms, r->hitches, + r->vram_peak_mb, r->ram_peak_mb, r->gpu_load_avg, r->gpu_temp_peak, r->gpu_clock_avg); + csv_escape(f, snap->gpu_name); fputc(',', f); + fprintf(f, "%d,%d,", snap->width, snap->height); + csv_escape(f, snap->settings_summary); fputc('\n', f); + } + fclose(f); + if (out_path && out_path_n) snprintf(out_path, out_path_n, "%s", path); + return true; +} + +#ifndef BENCH_STATS_ONLY + +static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; +static BenchSnapshot g_snap; +static bool g_pending_start; +static BenchConfig g_pending_cfg; +static bool g_pending_cancel; + +static int g_queue[BENCH_ROUTE_COUNT]; +static int g_queue_len; +static int g_queue_pos; + +static uint64_t g_phase_t0_ns; +static uint64_t g_prev_frame_ns; +static uint64_t g_last_perf_ns; + +static float g_orig_pos[3]; +static float g_orig_hour; +static bool g_orig_hour_held; +static int g_orig_fps_limit; +static int g_orig_vsync; +static int g_orig_frame_gen; +static int g_orig_perf_overlay; +static bool g_overrides_saved; +static bool g_tp_sent; +static bool g_cancelled_run; + +static uint32_t g_route_us[BENCH_MAX_FRAMES]; +static uint32_t g_route_frames; +static uint32_t *g_all_us; +static uint32_t g_all_frames; +static uint32_t g_all_cap; +static double g_all_duration_s; + +// Per-route hardware telemetry accumulators sampled once per second while measuring +static float g_vram_peak, g_ram_peak, g_temp_peak; +static double g_load_sum, g_clk_sum; +static int g_load_n, g_clk_n; + +static void push_live_sample(float ms) { + if (g_snap.live_spark_n < BENCH_SPARK_LEN) { + g_snap.live_spark[g_snap.live_spark_n++] = ms; + } else { + memmove(g_snap.live_spark, g_snap.live_spark + 1, (BENCH_SPARK_LEN - 1) * sizeof(float)); + g_snap.live_spark[BENCH_SPARK_LEN - 1] = ms; + } + // Exponential smoothing for readable live FPS/ms readout + if (ms > 0.01f) { + if (g_snap.live_ms <= 0.01f) g_snap.live_ms = ms; + else g_snap.live_ms = g_snap.live_ms * 0.90f + ms * 0.10f; + g_snap.live_fps = g_snap.live_ms > 0.01f ? 1000.0f / g_snap.live_ms : 0.0f; + } +} + +static void capture_metadata(void) { + PerfStats ps; + perfmon_snapshot(&ps); + snprintf(g_snap.gpu_name, sizeof g_snap.gpu_name, "%s", ps.gpu_name); + snprintf(g_snap.cpu_name, sizeof g_snap.cpu_name, "%s", ps.cpu_name); + + int w = g_settings.window_w > 0 ? g_settings.window_w : 1920; + int h = g_settings.window_h > 0 ? g_settings.window_h : 1080; +#ifndef SW_METAL + float ox = 0.0f, oy = 0.0f; + renderer_get_scale(&ox, &oy); + if (ox > 0.0f && oy > 0.0f) { + w = (int)lroundf(1920.0f * ox); + h = (int)lroundf(1080.0f * oy); + } +#endif + g_snap.width = w; + g_snap.height = h; + + static const char *const up_names[] = {"Off", "MetalFX", "FSR 1", "FSR 3", "DLSS", "FSR 4", "XeSS"}; + static const char *const sh_names[] = {"Console (896)", "High (2048)", "Ultra (4096)", "Extreme (8192)", "Potato (448)"}; + static const char *const dd_names[] = {"Original", "Medium", "High", "Potato"}; + int up = g_settings.upscaler >= 0 && g_settings.upscaler < UPSCALE_COUNT ? g_settings.upscaler : 0; + int sh = g_settings.shadow_res >= 0 && g_settings.shadow_res < SHADOW_COUNT ? g_settings.shadow_res : 0; + int dd = g_settings.draw_distance >= 0 && g_settings.draw_distance < DRAWDIST_COUNT ? g_settings.draw_distance : 0; + int aa = rt_antialias(); + const char *aa_s = rt_temporal_upscaler() ? rt_temporal_upscaler_name() + : aa == AA_TAA ? "TAA" : aa == AA_SMAA ? "SMAA" + : g_settings.game_fxaa ? "FXAA" : "Off"; + snprintf(g_snap.settings_summary, sizeof g_snap.settings_summary, + "Upscaler: %s | AA: %s | Shadows: %s | Draw distance: %s", + up_names[up], aa_s, sh_names[sh], dd_names[dd]); +} + +static void save_and_apply_overrides(const BenchConfig *cfg) { + if (!g_overrides_saved) { + g_orig_fps_limit = g_settings.fps_limit; + g_orig_vsync = g_settings.vsync; + g_orig_frame_gen = g_settings.frame_gen; + g_orig_perf_overlay = g_settings.perf_overlay; + g_overrides_saved = true; + } + if (cfg->uncap_fps) { + g_settings.fps_limit = 0; + g_settings.vsync = VSYNC_OFF; + g_settings.frame_gen = FG_OFF; + g_settings.perf_overlay = PERF_OFF; + } +} + +static void restore_overrides(void) { + if (g_overrides_saved) { + g_settings.fps_limit = g_orig_fps_limit; + g_settings.vsync = g_orig_vsync; + g_settings.frame_gen = g_orig_frame_gen; + g_settings.perf_overlay = g_orig_perf_overlay; + g_overrides_saved = false; + } + control_fly_set(false); + if (g_snap.cfg.mode != BENCH_MODE_SPOT) + test_warp_hold_hour(g_orig_hour_held && g_orig_hour >= 0.0f ? g_orig_hour : -1.0f); +} + +static void build_route_queue(const BenchConfig *cfg) { + g_queue_len = 0; + g_queue_pos = 0; + if (cfg->mode == BENCH_MODE_FULL) { + for (int i = 0; i < BENCH_ROUTE_COUNT; i++) g_queue[g_queue_len++] = i; + } else if (cfg->mode == BENCH_MODE_QUICK) { + g_queue[g_queue_len++] = 0; // Great Plateau + g_queue[g_queue_len++] = 1; // Kakariko Village + g_queue[g_queue_len++] = 6; // Korok Forest + } else if (cfg->mode == BENCH_MODE_SINGLE) { + int r = cfg->single_route; + if (r < 0 || r >= BENCH_ROUTE_COUNT) r = 0; + g_queue[g_queue_len++] = r; + } else { + g_queue[g_queue_len++] = -1; // Current spot + } +} + +static void begin_phase(BenchPhase p, uint64_t now_ns, double target_s) { + g_snap.phase = p; + g_phase_t0_ns = now_ns; + g_snap.phase_elapsed_s = 0.0; + g_snap.phase_target_s = target_s; +} + +static void start_current_route(uint64_t now_ns) { + int ridx = g_queue[g_queue_pos]; + g_snap.route_idx = g_queue_pos; + g_snap.route_total = g_queue_len; + g_tp_sent = false; + if (ridx < 0) { + snprintf(g_snap.current_route_name, sizeof g_snap.current_route_name, "Current spot"); + begin_phase(BENCH_SETTLING, now_ns, (double)g_snap.cfg.settle_s); + } else { + snprintf(g_snap.current_route_name, sizeof g_snap.current_route_name, "%s", k_routes[ridx].name); + begin_phase(BENCH_TELEPORTING, now_ns, 45.0); + } +} + +static void compute_overall_stats(void) { + if (g_all_frames == 0) { + memset(&g_snap.overall, 0, sizeof g_snap.overall); + return; + } + snprintf(g_snap.overall.id, sizeof g_snap.overall.id, "overall"); + snprintf(g_snap.overall.name, sizeof g_snap.overall.name, "Overall"); + float vram_max = 0, ram_max = 0, temp_max = 0; + double gload_sum = 0, gclk_sum = 0; + int gload_n = 0, gclk_n = 0; + for (int i = 0; i < g_snap.nresults; i++) { + const BenchRouteStats *r = &g_snap.results[i]; + if (!r->valid) continue; + if (r->vram_peak_mb > vram_max) vram_max = r->vram_peak_mb; + if (r->ram_peak_mb > ram_max) ram_max = r->ram_peak_mb; + if (r->gpu_temp_peak > temp_max) temp_max = r->gpu_temp_peak; + if (r->gpu_load_avg >= 0) { gload_sum += r->gpu_load_avg; gload_n++; } + if (r->gpu_clock_avg > 0) { gclk_sum += r->gpu_clock_avg; gclk_n++; } + } + g_snap.overall.vram_peak_mb = vram_max; + g_snap.overall.ram_peak_mb = ram_max; + g_snap.overall.gpu_temp_peak = temp_max; + g_snap.overall.gpu_load_avg = gload_n ? (float)(gload_sum / gload_n) : -1.0f; + g_snap.overall.gpu_clock_avg = gclk_n ? (float)(gclk_sum / gclk_n) : -1.0f; + bench_compute_stats(g_all_us, g_all_frames, g_all_duration_s, &g_snap.overall); + // bench_compute_stats preserves metadata we set on out above before memsetting frame stats +} + +static void enter_restoring(uint64_t now_ns) { + compute_overall_stats(); + g_snap.has_results = g_snap.nresults > 0; + restore_overrides(); + g_tp_sent = false; + if (g_snap.cfg.mode == BENCH_MODE_SPOT) { + g_snap.phase = g_cancelled_run ? BENCH_CANCELLED : BENCH_DONE; + menu_open_page(15); + return; + } + begin_phase(BENCH_RESTORING, now_ns, 15.0); +} + +static void record_failed_route(int ridx, const char *reason) { + if (g_snap.nresults >= BENCH_MAX_RESULTS) return; + BenchRouteStats *st = &g_snap.results[g_snap.nresults++]; + memset(st, 0, sizeof *st); + snprintf(st->id, sizeof st->id, "%s", ridx >= 0 ? k_routes[ridx].id : "spot"); + snprintf(st->name, sizeof st->name, "%s", ridx >= 0 ? k_routes[ridx].name : "Current spot"); + st->failed = true; + snprintf(st->fail_reason, sizeof st->fail_reason, "%s", reason); +} + +static void finish_measuring_route(uint64_t now_ns, double elapsed_s) { + int ridx = g_queue[g_queue_pos]; + if (g_snap.nresults < BENCH_MAX_RESULTS) { + BenchRouteStats *st = &g_snap.results[g_snap.nresults++]; + memset(st, 0, sizeof *st); + snprintf(st->id, sizeof st->id, "%s", ridx >= 0 ? k_routes[ridx].id : "spot"); + snprintf(st->name, sizeof st->name, "%s", ridx >= 0 ? k_routes[ridx].name : "Current spot"); + st->vram_peak_mb = g_vram_peak; + st->ram_peak_mb = g_ram_peak; + st->gpu_temp_peak = g_temp_peak; + st->gpu_load_avg = g_load_n ? (float)(g_load_sum / g_load_n) : -1.0f; + st->gpu_clock_avg = g_clk_n ? (float)(g_clk_sum / g_clk_n) : -1.0f; + bench_compute_stats(g_route_us, g_route_frames, elapsed_s, st); + } + // Append to combined buffer for accurate overall percentiles & 1% / 0.1% lows + if (g_route_frames > 0) { + uint32_t need = g_all_frames + g_route_frames; + if (need > g_all_cap) { + uint32_t new_cap = g_all_cap ? g_all_cap : 4096; + while (new_cap < need) new_cap *= 2; + uint32_t *p = (uint32_t *)realloc(g_all_us, (size_t)new_cap * sizeof *p); + if (p) { g_all_us = p; g_all_cap = new_cap; } + } + if (g_all_us && g_all_frames + g_route_frames <= g_all_cap) { + memcpy(g_all_us + g_all_frames, g_route_us, (size_t)g_route_frames * sizeof(uint32_t)); + g_all_frames += g_route_frames; + g_all_duration_s += elapsed_s; + } + } + g_queue_pos++; + if (g_queue_pos < g_queue_len) start_current_route(now_ns); + else enter_restoring(now_ns); +} + +bool bench_start(const BenchConfig *cfg) { + if (!cfg) return false; + float pos[3]; + if (!control_tp_link_pos(pos)) return false; + pthread_mutex_lock(&g_lock); + bool busy = (g_snap.phase >= BENCH_TELEPORTING && g_snap.phase <= BENCH_RESTORING) || g_pending_start; + if (!busy) { + g_pending_cfg = *cfg; + if (g_pending_cfg.duration_s < 3) g_pending_cfg.duration_s = 3; + if (g_pending_cfg.duration_s > 60) g_pending_cfg.duration_s = 60; + if (g_pending_cfg.settle_s < 1) g_pending_cfg.settle_s = 1; + if (g_pending_cfg.settle_s > 20) g_pending_cfg.settle_s = 20; + g_pending_start = true; + g_pending_cancel = false; + } + pthread_mutex_unlock(&g_lock); + return !busy; +} + +void bench_cancel(void) { + pthread_mutex_lock(&g_lock); + if (g_pending_start) { + g_pending_start = false; + } else if (g_snap.phase >= BENCH_TELEPORTING && g_snap.phase <= BENCH_RESTORING) { + g_pending_cancel = true; + } + pthread_mutex_unlock(&g_lock); +} + +bool bench_active(void) { + pthread_mutex_lock(&g_lock); + bool a = g_snap.phase >= BENCH_TELEPORTING && g_snap.phase <= BENCH_RESTORING; + pthread_mutex_unlock(&g_lock); + return a; +} + +bool bench_hud_visible(void) { + return bench_active(); +} + +void bench_snapshot(BenchSnapshot *out) { + if (!out) return; + pthread_mutex_lock(&g_lock); + *out = g_snap; + pthread_mutex_unlock(&g_lock); +} + +void bench_frame(uint64_t frame) { + (void)frame; + uint64_t now = plat_now_ns(); + uint64_t dt_ns = (g_prev_frame_ns && now > g_prev_frame_ns) ? (now - g_prev_frame_ns) : 0; + g_prev_frame_ns = now; + + pthread_mutex_lock(&g_lock); + if (g_pending_start) { + g_pending_start = false; + g_cancelled_run = false; + if (control_tp_link_pos(g_orig_pos)) { + g_orig_hour = test_warp_hour(&g_orig_hour_held); + memset(&g_snap.results, 0, sizeof g_snap.results); + memset(&g_snap.overall, 0, sizeof g_snap.overall); + g_snap.nresults = 0; + g_snap.has_results = false; + g_snap.live_spark_n = 0; + g_snap.live_fps = 0.0f; + g_snap.live_ms = 0.0f; + g_snap.cfg = g_pending_cfg; + g_all_frames = 0; + g_all_duration_s = 0.0; + capture_metadata(); + save_and_apply_overrides(&g_snap.cfg); + build_route_queue(&g_snap.cfg); + start_current_route(now); + LOG("[benchmark] started mode=%d routes=%d duration=%ds settle=%ds\n", + g_snap.cfg.mode, g_queue_len, g_snap.cfg.duration_s, g_snap.cfg.settle_s); + } + } + + if (g_pending_cancel) { + g_pending_cancel = false; + if (g_snap.phase == BENCH_RESTORING) { + restore_overrides(); + g_snap.phase = BENCH_CANCELLED; + menu_open_page(15); + LOG("[benchmark] force-cancelled during restore\n"); + } else if (g_snap.phase >= BENCH_TELEPORTING && g_snap.phase < BENCH_RESTORING) { + g_cancelled_run = true; + LOG("[benchmark] cancelled by user\n"); + enter_restoring(now); + } + } + + if (g_snap.phase < BENCH_TELEPORTING || g_snap.phase > BENCH_RESTORING) { + pthread_mutex_unlock(&g_lock); + return; + } + + if (dt_ns > 0) push_live_sample((float)((double)dt_ns / 1e6)); + double elapsed = (double)(now - g_phase_t0_ns) / 1e9; + g_snap.phase_elapsed_s = elapsed; + + int ridx = (g_queue_pos >= 0 && g_queue_pos < g_queue_len) ? g_queue[g_queue_pos] : -1; + + switch (g_snap.phase) { + case BENCH_TELEPORTING: { + if (ridx < 0 || ridx >= BENCH_ROUTE_COUNT) { enter_restoring(now); break; } + const BenchRouteInfo *r = &k_routes[ridx]; + if (!g_tp_sent) { + if (control_tp_request(r->x, r->y, r->z)) { + g_tp_sent = true; + } else if (elapsed > 5.0) { + record_failed_route(ridx, "Teleport unavailable"); + g_queue_pos++; + if (g_queue_pos < g_queue_len) start_current_route(now); + else enter_restoring(now); + } + break; + } + int st = control_tp_status(NULL, 0); + if (st == 2) { + control_fly_set(true); + test_warp_set_hour(r->hour); + test_warp_hold_hour(r->hour); + control_look_start(true, r->yaw, true, r->pitch, 15); + begin_phase(BENCH_AIMING, now, 4.0); + } else if (st == 3 || elapsed >= 45.0) { + record_failed_route(ridx, st == 3 ? "Teleport failed" : "Teleport timed out"); + g_queue_pos++; + if (g_queue_pos < g_queue_len) start_current_route(now); + else enter_restoring(now); + } + break; + } + case BENCH_AIMING: { + if (!control_look_active() || elapsed >= 4.0) { + begin_phase(BENCH_SETTLING, now, (double)g_snap.cfg.settle_s); + } + break; + } + case BENCH_SETTLING: { + if (elapsed >= (double)g_snap.cfg.settle_s) { + g_route_frames = 0; + g_vram_peak = 0.0f; + g_ram_peak = 0.0f; + g_temp_peak = 0.0f; + g_load_sum = 0.0; + g_clk_sum = 0.0; + g_load_n = 0; + g_clk_n = 0; + g_last_perf_ns = 0; + begin_phase(BENCH_MEASURING, now, (double)g_snap.cfg.duration_s); + } + break; + } + case BENCH_MEASURING: { + if (dt_ns > 0 && g_route_frames < BENCH_MAX_FRAMES) { + uint32_t us = (uint32_t)(dt_ns / 1000ull); + g_route_us[g_route_frames++] = us ? us : 1; + } + if (!g_last_perf_ns || now - g_last_perf_ns >= 1000000000ull) { + g_last_perf_ns = now; + PerfStats ps; + perfmon_snapshot(&ps); + if (ps.vram_used_mb > g_vram_peak) g_vram_peak = ps.vram_used_mb; + if (ps.ram_game_mb > g_ram_peak) g_ram_peak = ps.ram_game_mb; + if (ps.gpu_temp_c > g_temp_peak) g_temp_peak = ps.gpu_temp_c; + if (ps.gpu_pct >= 0.0f) { g_load_sum += ps.gpu_pct; g_load_n++; } + if (ps.gpu_clock_mhz > 0.0f) { g_clk_sum += ps.gpu_clock_mhz; g_clk_n++; } + } + if (elapsed >= (double)g_snap.cfg.duration_s || g_route_frames >= BENCH_MAX_FRAMES) { + finish_measuring_route(now, elapsed); + } + break; + } + case BENCH_RESTORING: { + if (!g_tp_sent) { + if (control_tp_request(g_orig_pos[0], g_orig_pos[1], g_orig_pos[2])) g_tp_sent = true; + else if (elapsed >= 2.0) { + g_snap.phase = g_cancelled_run ? BENCH_CANCELLED : BENCH_DONE; + menu_open_page(15); + } + break; + } + int st = control_tp_status(NULL, 0); + if (st == 2 || st == 3 || elapsed >= 15.0) { + g_snap.phase = g_cancelled_run ? BENCH_CANCELLED : BENCH_DONE; + menu_open_page(15); + LOG("[benchmark] finished (%s), %d routes recorded\n", + g_cancelled_run ? "cancelled" : "done", g_snap.nresults); + } + break; + } + default: + break; + } + pthread_mutex_unlock(&g_lock); +} + +RT_ON_RESET(bench_reset) { + pthread_mutex_lock(&g_lock); + if (g_overrides_saved) { + g_settings.fps_limit = g_orig_fps_limit; + g_settings.vsync = g_orig_vsync; + g_settings.frame_gen = g_orig_frame_gen; + g_settings.perf_overlay = g_orig_perf_overlay; + g_overrides_saved = false; + } + g_snap.phase = BENCH_IDLE; + g_pending_start = false; + g_pending_cancel = false; + g_tp_sent = false; + g_cancelled_run = false; + g_prev_frame_ns = 0; + free(g_all_us); + g_all_us = NULL; + g_all_cap = 0; + g_all_frames = 0; + pthread_mutex_unlock(&g_lock); +} + +#endif diff --git a/runtime/benchmark.h b/runtime/benchmark.h new file mode 100644 index 000000000..fb98835fc --- /dev/null +++ b/runtime/benchmark.h @@ -0,0 +1,118 @@ +// In-game fixed-view performance benchmark (runtime/benchmark.c, runtime/ui/benchmark_ui.mm). +// Measures the canonical scenes from tools/perf_routes.py (or the player's current spot) directly from the F1 menu: +// teleport -> hold sky/fly -> aim camera -> warm up -> sample per-frame deltas -> compute percentiles/lows/hitches -> restore. +#pragma once +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define BENCH_ROUTE_COUNT 7 +#define BENCH_MAX_RESULTS 8 +#define BENCH_SPARK_LEN 120 +#define BENCH_MAX_FRAMES 32768 + +enum BenchMode { + BENCH_MODE_FULL = 0, // all 7 canonical routes + BENCH_MODE_QUICK = 1, // Plateau, Kakariko, Korok Forest + BENCH_MODE_SINGLE = 2, // one chosen canonical route + BENCH_MODE_SPOT = 3, // Link's current position and view (no teleport) +}; + +typedef enum { + BENCH_IDLE = 0, + BENCH_TELEPORTING, + BENCH_AIMING, + BENCH_SETTLING, + BENCH_MEASURING, + BENCH_RESTORING, + BENCH_DONE, + BENCH_CANCELLED, +} BenchPhase; + +typedef struct { + int mode; // BenchMode + int single_route; // 0..BENCH_ROUTE_COUNT-1 (BENCH_MODE_SINGLE) + int duration_s; // sample window per route (seconds) + int settle_s; // warm-up settle window before sampling (seconds) + bool uncap_fps; // uncap fps_limit, vsync, frame_gen and perf_overlay during the run +} BenchConfig; + +typedef struct { + const char *id; + const char *name; + float x, y, z; + double yaw, pitch; + float hour; + bool hover; +} BenchRouteInfo; + +typedef struct { + char id[32]; + char name[64]; + bool valid; + bool failed; + char fail_reason[96]; + uint32_t frames; + double duration_s; + double avg_fps; + double low_1pct_fps; + double low_01pct_fps; + double avg_ms; + double median_ms; + double p95_ms; + double p99_ms; + double min_ms; + double max_ms; + uint32_t hitches; + float spark_ms[BENCH_SPARK_LEN]; + int spark_n; + float vram_peak_mb; + float ram_peak_mb; + float gpu_load_avg; + float gpu_temp_peak; + float gpu_clock_avg; +} BenchRouteStats; + +typedef struct { + BenchPhase phase; + BenchConfig cfg; + int route_idx; // 0-based index in the current suite + int route_total; + char current_route_name[64]; + double phase_elapsed_s; + double phase_target_s; + float live_fps; + float live_ms; + float live_spark[BENCH_SPARK_LEN]; + int live_spark_n; + bool has_results; + int nresults; + BenchRouteStats results[BENCH_MAX_RESULTS]; + BenchRouteStats overall; + char gpu_name[96]; + char cpu_name[64]; + int width, height; + char settings_summary[256]; +} BenchSnapshot; + +int bench_route_count(void); +const BenchRouteInfo *bench_route_info(int i); + +bool bench_start(const BenchConfig *cfg); +void bench_cancel(void); +bool bench_active(void); +bool bench_hud_visible(void); +void bench_snapshot(BenchSnapshot *out); +void bench_frame(uint64_t frame); + +void bench_compute_stats(const uint32_t *frame_us, uint32_t count, double duration_s, BenchRouteStats *out); +size_t bench_format_markdown(const BenchSnapshot *snap, char *buf, size_t n); +bool bench_save_csv(const BenchSnapshot *snap, char *out_path, size_t out_path_n); + +#ifdef __cplusplus +} +#endif diff --git a/runtime/control.c b/runtime/control.c index 15dd9c144..71de4fc00 100644 --- a/runtime/control.c +++ b/runtime/control.c @@ -534,9 +534,15 @@ int control_console_names(const char *prefix, const char **out, int max) { return n; } +extern void bench_frame(uint64_t frame); +extern bool bench_active(void); +extern void control_tp_frame(uint64_t frame); + void control_frame(uint64_t frame) { if (!initialized) return; control_place_frame(); + bench_frame(frame); + if (!dev_mode && bench_active()) control_tp_frame(frame); if (dev_mode) control_game_frame(frame); console_pump(); if (!queued) return; diff --git a/runtime/control_input.c b/runtime/control_input.c index a9a847a43..ea0d16261 100644 --- a/runtime/control_input.c +++ b/runtime/control_input.c @@ -215,11 +215,15 @@ bool control_look_start(bool use_yaw, double yaw, bool use_pitch, double pitch, return true; } +bool control_look_active(void) { return look.state == LOOK_RUN; } + // Called even when no script exists. Expiry uses presented frames, never script time or poll count. void control_input_frame(uint64_t frame) { - if (!atomic_load_explicit(&enabled, memory_order_relaxed)) return; + extern bool bench_active(void); + if (!atomic_load_explicit(&enabled, memory_order_relaxed) && !bench_active()) return; if (look.state == LOOK_RUN) look_step(frame); control_fly_frame(frame); + if (!atomic_load_explicit(&enabled, memory_order_relaxed)) return; uint64_t b = 0; for (int i = 0; i < 16; i++) if (held[i] || frame < until[i]) b |= 1ull << i; atomic_store(&buttons, b); @@ -233,7 +237,11 @@ void control_input_frame(uint64_t frame) { } static int32_t clamp(int32_t v) { return v > 32767 ? 32767 : v < -32767 ? -32767 : v; } void control_input_apply(uint64_t *b, int32_t *lx, int32_t *ly, int32_t *rx, int32_t *ry) { - if (!atomic_load_explicit(&enabled, memory_order_relaxed)) return; + extern bool bench_active(void); + if (!atomic_load_explicit(&enabled, memory_order_relaxed)) { + if (bench_active()) control_fly_input(b, lx, ly); + return; + } *b |= atomic_load(&buttons); if (!lx) { control_fly_input(b, NULL, NULL); return; } int32_t *x[] = {lx, rx}, *y[] = {ly, ry}; diff --git a/runtime/ui/benchmark_ui.h b/runtime/ui/benchmark_ui.h new file mode 100644 index 000000000..cc78ad6c5 --- /dev/null +++ b/runtime/ui/benchmark_ui.h @@ -0,0 +1,13 @@ +// In-game benchmark menu page and live progress HUD (runtime/ui/benchmark_ui.mm). +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +void bench_ui_tab(bool *want_close); +void bench_ui_overlay(float display_w, float display_h, float scale); + +#ifdef __cplusplus +} +#endif diff --git a/runtime/ui/benchmark_ui.mm b/runtime/ui/benchmark_ui.mm new file mode 100644 index 000000000..5bb97763f --- /dev/null +++ b/runtime/ui/benchmark_ui.mm @@ -0,0 +1,323 @@ +// Benchmark page in the F1 menu and live top-right progress HUD (runtime/benchmark.h, runtime/ui/menu.mm). +#include +#include +#include + +#include "imgui.h" +#include "i18n.h" +#include "option_rows.h" +#include "ui_theme.h" +#include "benchmark_ui.h" + +extern "C" { +#include +#include "../benchmark.h" +#include "../control.h" +} + +namespace { + +void kpi_card(const char *id, const char *label, const char *value, ImVec4 val_col, float w, float u) { + ImGui::BeginChild(id, ImVec2(w, 64 * u), ImGuiChildFlags_Border, ImGuiWindowFlags_NoScrollbar); + ImGui::TextDisabled("%s", label); + ImGui::SetWindowFontScale(1.22f); + ImGui::TextColored(val_col, "%s", value); + ImGui::SetWindowFontScale(1.0f); + ImGui::EndChild(); +} + +void draw_frametime_graph(const BenchRouteStats *r, float scale) { + if (!r || !r->valid || r->spark_n <= 0) return; + float w = ImGui::GetContentRegionAvail().x; + if (w < 120 * scale) w = 120 * scale; + float h = 130 * scale; + + ImVec2 p0 = ImGui::GetCursorScreenPos(); + ImVec2 p1(p0.x + w, p0.y + h); + ImGui::Dummy(ImVec2(w, h)); + + ImDrawList *dl = ImGui::GetWindowDrawList(); + dl->AddRectFilled(p0, p1, IM_COL32(14, 20, 18, 220), 6.0f * scale); + dl->AddRect(p0, p1, IM_COL32(70, 90, 82, 180), 6.0f * scale); + + float max_ms = (float)r->max_ms; + if (max_ms < 40.0f) max_ms = 40.0f; + if (max_ms > 100.0f) max_ms = 100.0f; + + struct RefLine { float ms; const char *lbl; ImU32 col; }; + const RefLine refs[] = { + {33.333f, "30 FPS (33.3 ms)", IM_COL32(220, 90, 80, 140)}, + {16.667f, "60 FPS (16.7 ms)", IM_COL32(230, 195, 75, 140)}, + {8.333f, "120 FPS (8.3 ms)", IM_COL32(115, 205, 105, 140)}, + }; + for (const RefLine &rf : refs) { + if (rf.ms >= max_ms) continue; + float y = p1.y - (rf.ms / max_ms) * (h - 8 * scale) - 4 * scale; + dl->AddLine(ImVec2(p0.x + 2, y), ImVec2(p1.x - 2, y), rf.col, 1.0f); + dl->AddText(ImVec2(p0.x + 6 * scale, y - ImGui::GetFontSize() * 0.95f), rf.col, rf.lbl); + } + + int n = r->spark_n; + float dx = n > 1 ? (w - 8 * scale) / (float)(n - 1) : 0.0f; + for (int i = 1; i < n; i++) { + float v0 = r->spark_ms[i - 1], v1 = r->spark_ms[i]; + if (v0 > max_ms) v0 = max_ms; + if (v1 > max_ms) v1 = max_ms; + ImVec2 a(p0.x + 4 * scale + (float)(i - 1) * dx, p1.y - (v0 / max_ms) * (h - 8 * scale) - 4 * scale); + ImVec2 b(p0.x + 4 * scale + (float)i * dx, p1.y - (v1 / max_ms) * (h - 8 * scale) - 4 * scale); + ImU32 lc = v1 > 33.333f ? IM_COL32(235, 95, 85, 255) : v1 > 16.667f ? IM_COL32(235, 200, 85, 255) : IM_COL32(125, 215, 115, 255); + dl->AddLine(a, b, lc, 1.8f * scale); + } +} + +} // namespace + +void bench_ui_tab(bool *want_close) { + static int mode = BENCH_MODE_FULL; + static int single_route = 0; + static int dur_idx = 1; // 10 s + static int settle_idx = 1; // 5 s + static bool uncap = true; + static int selected_row = -1; // -1 = overall + static char notice[280]; + + float scale = ImGui::GetFontSize() / 34.0f; + if (scale < 0.45f) scale = 0.45f; + BenchSnapshot snap; + bench_snapshot(&snap); + + opt_begin("##benchmark", scale); + + float pos[3]; + bool in_world = control_tp_link_pos(pos); + if (!in_world && !snap.has_results) { + ImGui::TextDisabled("%s", tr("Load a save and enter the world to run the benchmark.")); + opt_end(); + return; + } + + opt_section(tr("Suite setup")); + static const char *const suite_names[] = { + "Full suite (7 routes)", "Quick suite (3 routes)", "Single route", "Current spot", + }; + opt_choice(tr("Suite"), &mode, suite_names, 4, BENCH_MODE_FULL, + tr("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.")); + + if (mode == BENCH_MODE_SINGLE) { + const char *rnames[BENCH_ROUTE_COUNT]; + for (int i = 0; i < BENCH_ROUTE_COUNT; i++) { + const BenchRouteInfo *ri = bench_route_info(i); + rnames[i] = ri ? tr(ri->name) : ""; + } + opt_choice(tr("Route"), &single_route, rnames, BENCH_ROUTE_COUNT, 0, + tr("Which fixed camera route to measure.")); + } + + static const char *const dur_names[] = {"5 s", "10 s", "15 s", "20 s"}; + static const int dur_vals[] = {5, 10, 15, 20}; + opt_choice(tr("Sample duration"), &dur_idx, dur_names, 4, 1, + tr("How long each route samples frame times after warming up.")); + + static const char *const settle_names[] = {"3 s", "5 s", "8 s"}; + static const int settle_vals[] = {3, 5, 8}; + opt_choice(tr("Warm-up"), &settle_idx, settle_names, 3, 1, + tr("Settle window after teleporting and aiming before frame capture begins.")); + + opt_toggle(tr("Uncap FPS and VSync"), &uncap, true, + tr("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.")); + + bool active = snap.phase >= BENCH_TELEPORTING && snap.phase <= BENCH_RESTORING; + if (!in_world) opt_disable_next(); + if (opt_action(tr("Start benchmark"), active ? tr("Running...") : (in_world ? tr("Start") : tr("In world only")), + tr("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results."), true)) { + if (!active && in_world) { + BenchConfig cfg = {mode, single_route, dur_vals[dur_idx], settle_vals[settle_idx], uncap}; + if (bench_start(&cfg)) { + notice[0] = 0; + selected_row = -1; + if (want_close) *want_close = true; + } + } + } + + if (snap.phase == BENCH_CANCELLED && !snap.has_results) { + ImGui::TextDisabled("%s", tr("Benchmark cancelled.")); + } + + if (snap.has_results) { + opt_section(tr("Results")); + if (snap.phase == BENCH_CANCELLED) + ImGui::TextColored(ImVec4(0.95f, 0.72f, 0.30f, 1.0f), "%s", tr("Partial results (cancelled early):")); + + const BenchRouteStats *kpi = snap.overall.valid ? &snap.overall : &snap.results[0]; + if (kpi && kpi->valid) { + float avail = ImGui::GetContentRegionAvail().x; + float gap = ImGui::GetStyle().ItemSpacing.x; + float cw = (avail - gap * 4.0f) / 5.0f; + if (cw < 80 * scale) cw = 80 * scale; + char v_avg[24], v_1p[24], v_01p[24], v_hit[24], v_vram[24]; + snprintf(v_avg, sizeof v_avg, "%.1f", kpi->avg_fps); + snprintf(v_1p, sizeof v_1p, "%.1f", kpi->low_1pct_fps); + snprintf(v_01p, sizeof v_01p, "%.1f", kpi->low_01pct_fps); + snprintf(v_hit, sizeof v_hit, "%u", kpi->hitches); + if (kpi->vram_peak_mb > 0) snprintf(v_vram, sizeof v_vram, "%.0f MB", kpi->vram_peak_mb); + else snprintf(v_vram, sizeof v_vram, "-"); + + kpi_card("##k1", tr("Avg FPS"), v_avg, ImVec4(0.55f, 0.88f, 0.38f, 1.0f), cw, scale); + ImGui::SameLine(); + kpi_card("##k2", tr("1% Low"), v_1p, ImVec4(0.92f, 0.80f, 0.32f, 1.0f), cw, scale); + ImGui::SameLine(); + kpi_card("##k3", tr("0.1% Low"), v_01p, ImVec4(0.90f, 0.56f, 0.32f, 1.0f), cw, scale); + ImGui::SameLine(); + kpi_card("##k4", tr("Hitches"), v_hit, kpi->hitches ? ImVec4(0.92f, 0.38f, 0.35f, 1.0f) : ImVec4(0.55f, 0.88f, 0.38f, 1.0f), cw, scale); + ImGui::SameLine(); + kpi_card("##k5", tr("Peak VRAM"), v_vram, ImVec4(0.38f, 0.72f, 0.92f, 1.0f), cw, scale); + } + + if (snap.gpu_name[0] || snap.width > 0) { + ImGui::TextDisabled("%s | %dx%d | %s", snap.gpu_name[0] ? snap.gpu_name : "GPU", snap.width, snap.height, snap.settings_summary); + } + + ImGuiTableFlags tf = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingStretchProp; + if (ImGui::BeginTable("##bench_tbl", 8, tf)) { + ImGui::TableSetupColumn(tr("Route"), ImGuiTableColumnFlags_WidthStretch, 1.8f); + ImGui::TableSetupColumn(tr("Avg FPS")); + ImGui::TableSetupColumn(tr("1% Low")); + ImGui::TableSetupColumn(tr("0.1% Low")); + ImGui::TableSetupColumn(tr("Avg ms")); + ImGui::TableSetupColumn(tr("p99 ms")); + ImGui::TableSetupColumn(tr("Max ms")); + ImGui::TableSetupColumn(tr("Hitches")); + ImGui::TableHeadersRow(); + + for (int i = 0; i < snap.nresults && i < BENCH_MAX_RESULTS; i++) { + const BenchRouteStats *r = &snap.results[i]; + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::PushID(i); + if (ImGui::Selectable(r->name[0] ? r->name : r->id, selected_row == i, ImGuiSelectableFlags_SpanAllColumns)) selected_row = i; + ImGui::PopID(); + if (!r->valid) { + ImGui::TableNextColumn(); ImGui::TextColored(ImVec4(0.92f, 0.38f, 0.35f, 1.0f), "%s", r->fail_reason[0] ? r->fail_reason : tr("Failed")); + for (int c = 0; c < 6; c++) { ImGui::TableNextColumn(); ImGui::TextDisabled("-"); } + continue; + } + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->avg_fps); + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->low_1pct_fps); + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->low_01pct_fps); + ImGui::TableNextColumn(); ImGui::Text("%.2f", r->avg_ms); + ImGui::TableNextColumn(); ImGui::Text("%.2f", r->p99_ms); + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->max_ms); + ImGui::TableNextColumn(); ImGui::Text("%u", r->hitches); + } + if (snap.overall.valid && snap.nresults > 1) { + const BenchRouteStats *r = &snap.overall; + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::PushID(-1); + if (ImGui::Selectable(tr("Overall"), selected_row == -1, ImGuiSelectableFlags_SpanAllColumns)) selected_row = -1; + ImGui::PopID(); + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->avg_fps); + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->low_1pct_fps); + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->low_01pct_fps); + ImGui::TableNextColumn(); ImGui::Text("%.2f", r->avg_ms); + ImGui::TableNextColumn(); ImGui::Text("%.2f", r->p99_ms); + ImGui::TableNextColumn(); ImGui::Text("%.1f", r->max_ms); + ImGui::TableNextColumn(); ImGui::Text("%u", r->hitches); + } + ImGui::EndTable(); + } + + const BenchRouteStats *graph_r = (selected_row >= 0 && selected_row < snap.nresults) + ? &snap.results[selected_row] + : (snap.overall.valid ? &snap.overall : &snap.results[0]); + if (graph_r && graph_r->valid) { + ImGui::TextDisabled("%s: %s (%.1f - %.1f ms, %s %.2f ms)", + tr("Frame time"), graph_r->name[0] ? graph_r->name : tr("Overall"), + graph_r->min_ms, graph_r->max_ms, tr("median"), graph_r->median_ms); + draw_frametime_graph(graph_r, scale); + } + + if (opt_action(tr("Copy Markdown report"), tr("Copy"), + tr("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard."), true)) { + char md[4096]; + bench_format_markdown(&snap, md, sizeof md); + SDL_SetClipboardText(md); + snprintf(notice, sizeof notice, "%s", tr("Copied Markdown benchmark report to clipboard.")); + } + if (opt_action(tr("Save CSV report"), tr("Save"), + tr("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder."), true)) { + char path[600]; + if (bench_save_csv(&snap, path, sizeof path)) { + snprintf(notice, sizeof notice, "%s: %s", tr("Saved CSV"), path); + } else { + snprintf(notice, sizeof notice, "%s", tr("Could not save CSV file.")); + } + } + if (notice[0]) ImGui::TextDisabled("%s", notice); + } + + opt_end(); +} + +void bench_ui_overlay(float display_w, float display_h, float scale) { + (void)display_h; + BenchSnapshot snap; + bench_snapshot(&snap); + if (snap.phase < BENCH_TELEPORTING || snap.phase > BENCH_RESTORING) return; + + ImGui::SetNextWindowPos(ImVec2(display_w - 16 * scale, 16 * scale), 0, ImVec2(1.0f, 0.0f)); + ImGui::SetNextWindowBgAlpha(0.78f); + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(22 * scale, 18 * scale)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 12 * scale); + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(10 * scale, 8 * scale)); + ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.05f, 0.08f, 0.07f, 0.94f)); + ImGui::PushStyleColor(ImGuiCol_PlotLines, ImVec4(0.55f, 0.88f, 0.38f, 1.0f)); + struct PopGuard { ~PopGuard() { ImGui::PopStyleColor(2); ImGui::PopStyleVar(3); } } pop_guard; + + ImGui::Begin("##bench_hud", NULL, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | + ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoFocusOnAppearing); + ImGui::SetWindowFontScale(0.76f); + + if (snap.phase == BENCH_RESTORING) { + ImGui::TextColored(ImVec4(0.95f, 0.78f, 0.35f, 1.0f), "%s", tr("BENCHMARK")); + } else { + ImGui::TextColored(ImVec4(0.55f, 0.88f, 0.38f, 1.0f), "%s %d / %d", + tr("BENCHMARK"), snap.route_idx + 1, snap.route_total > 0 ? snap.route_total : 1); + } + ImGui::SameLine(); + ImGui::Text("- %s", snap.current_route_name[0] ? snap.current_route_name : ""); + + const char *phase_lbl = tr("Preparing..."); + switch (snap.phase) { + case BENCH_TELEPORTING: phase_lbl = tr("Teleporting..."); break; + case BENCH_AIMING: phase_lbl = tr("Aiming camera..."); break; + case BENCH_SETTLING: phase_lbl = tr("Warming up..."); break; + case BENCH_MEASURING: phase_lbl = tr("Measuring..."); break; + case BENCH_RESTORING: phase_lbl = tr("Restoring position..."); break; + default: break; + } + + float frac = 0.0f; + if (snap.phase == BENCH_SETTLING || snap.phase == BENCH_MEASURING || snap.phase == BENCH_AIMING) { + if (snap.phase_target_s > 0.0) frac = (float)(snap.phase_elapsed_s / snap.phase_target_s); + if (frac < 0.0f) frac = 0.0f; + if (frac > 1.0f) frac = 1.0f; + ImGui::Text("%s %.1f / %.0f s", phase_lbl, snap.phase_elapsed_s, snap.phase_target_s); + } else { + ImGui::Text("%s (%.1f s)", phase_lbl, snap.phase_elapsed_s); + frac = (float)fmod(snap.phase_elapsed_s * 0.5, 1.0); + } + ImGui::ProgressBar(frac, ImVec2(290 * scale, 10 * scale), ""); + + ImGui::Text("%.0f FPS %.1f ms", snap.live_fps, snap.live_ms); + if (snap.live_spark_n > 1) { + float top = 40.0f; + for (int i = 0; i < snap.live_spark_n; i++) + if (snap.live_spark[i] > top) top = snap.live_spark[i]; + if (top > 100.0f) top = 100.0f; + ImGui::PlotLines("##bhud_plot", snap.live_spark, snap.live_spark_n, 0, NULL, 0.0f, top, ImVec2(290 * scale, 36 * scale)); + } + ImGui::TextDisabled("%s", tr("Press Esc to cancel")); + ImGui::End(); +} diff --git a/runtime/ui/i18n/de.inc b/runtime/ui/i18n/de.inc index 98b8c277e..aa4b4e49a 100644 --- a/runtime/ui/i18n/de.inc +++ b/runtime/ui/i18n/de.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps bis zum nächsten F5") T("Frame rate as set again", "Bildrate wieder wie eingestellt") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps für ein Physikrätsel, bis zum erneuten Drücken: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "Benchmark") +T("Load a save and enter the world to run the benchmark.", "Lade einen Spielstand und betritt die Spielwelt, um den Benchmark zu starten.") +T("Suite setup", "Testkonfiguration") +T("Full suite (7 routes)", "Vollständig (7 Routen)") +T("Quick suite (3 routes)", "Schnell (3 Routen)") +T("Single route", "Einzelne Route") +T("Suite", "Testreihe") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "Vollständig misst alle 7 festen Ansichten in Hyrule. Schnell misst Plateau, Kakariko und den Krog-Wald. Aktuelle Position misst dort, wo Link gerade steht.") +T("Route", "Route") +T("Which fixed camera route to measure.", "Welche feste Kameraansicht gemessen werden soll.") +T("Sample duration", "Messdauer") +T("How long each route samples frame times after warming up.", "Wie lange jede Route nach dem Aufwärmen Framezeiten misst.") +T("Warm-up", "Aufwärmen") +T("Settle window after teleporting and aiming before frame capture begins.", "Wartezeit nach Teleport und Kameraausrichtung vor Beginn der Messung.") +T("Uncap FPS and VSync", "FPS-Limit & VSync aufheben") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "Deaktiviert während der Messung vorübergehend FPS-Limit, VSync und Frame-Generierung und stellt sie danach wieder her.") +T("Start benchmark", "Benchmark starten") +T("Running...", "Läuft...") +T("Start", "Start") +T("In world only", "Nur im Spiel") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "Führt die gewählte Testreihe aus und bringt Link mit vollständigen Ergebnissen zurück an den Ausgangsort.") +T("Benchmark cancelled.", "Benchmark abgebrochen.") +T("Results", "Ergebnisse") +T("Partial results (cancelled early):", "Teilergebnisse (vorzeitig abgebrochen):") +T("Avg FPS", "Ø FPS") +T("1% Low", "1% Low") +T("0.1% Low", "0,1% Low") +T("Hitches", "Ruckler") +T("Peak VRAM", "Max. VRAM") +T("Avg ms", "Ø ms") +T("p99 ms", "p99 ms") +T("Max ms", "Max ms") +T("Failed", "Fehlgeschlagen") +T("Overall", "Gesamt") +T("Frame time", "Framezeit") +T("median", "Median") +T("Copy Markdown report", "Markdown-Bericht kopieren") +T("Copy", "Kopieren") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "Kopiert eine formatierte Markdown-Tabelle aller Routen und Systeminfos in die Zwischenablage.") +T("Copied Markdown benchmark report to clipboard.", "Markdown-Benchmark-Bericht in die Zwischenablage kopiert.") +T("Save CSV report", "CSV-Bericht speichern") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "Speichert detaillierte Messwerte pro Route als CSV-Datei mit Zeitstempel im Ordner benchmarks.") +T("Saved CSV", "CSV gespeichert") +T("Could not save CSV file.", "CSV-Datei konnte nicht gespeichert werden.") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "Vorbereiten...") +T("Teleporting...", "Teleportiere...") +T("Aiming camera...", "Richte Kamera aus...") +T("Warming up...", "Aufwärmen...") +T("Measuring...", "Messung läuft...") +T("Restoring position...", "Stelle Position wieder her...") +T("Press Esc to cancel", "Esc zum Abbrechen drücken") diff --git a/runtime/ui/i18n/es.inc b/runtime/ui/i18n/es.inc index 60b050041..5d510509f 100644 --- a/runtime/ui/i18n/es.inc +++ b/runtime/ui/i18n/es.inc @@ -1555,3 +1555,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps hasta volver a pulsar F5") T("Frame rate as set again", "Frecuencia de cuadros como estaba") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps para un puzle de física, hasta volver a pulsarla: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "Benchmark") +T("Load a save and enter the world to run the benchmark.", "Carga una partida y entra al mundo para ejecutar el benchmark.") +T("Suite setup", "Configuración de prueba") +T("Full suite (7 routes)", "Completa (7 rutas)") +T("Quick suite (3 routes)", "Rápida (3 rutas)") +T("Single route", "Una sola ruta") +T("Suite", "Serie") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "Completa recorre las 7 vistas canónicas de Hyrule. Rápida mide Meseta, Kakariko y el Bosque Kolog. Posición actual mide donde está Link ahora.") +T("Route", "Ruta") +T("Which fixed camera route to measure.", "Qué vista fija de cámara se medirá.") +T("Sample duration", "Duración de muestra") +T("How long each route samples frame times after warming up.", "Cuánto tiempo mide cada ruta los tiempos de frame tras calentar.") +T("Warm-up", "Calentamiento") +T("Settle window after teleporting and aiming before frame capture begins.", "Espera tras teletransportar y apuntar la cámara antes de empezar a medir.") +T("Uncap FPS and VSync", "Desbloquear FPS y VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "Desactiva temporalmente el límite de FPS, VSync y generación de frames durante la prueba y los restaura al terminar.") +T("Start benchmark", "Iniciar benchmark") +T("Running...", "Ejecutando...") +T("Start", "Iniciar") +T("In world only", "Solo en el mundo") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "Ejecuta la serie elegida y devuelve a Link a su posición inicial con todos los resultados.") +T("Benchmark cancelled.", "Benchmark cancelado.") +T("Results", "Resultados") +T("Partial results (cancelled early):", "Resultados parciales (cancelado antes):") +T("Avg FPS", "FPS medios") +T("1% Low", "1% mínimo") +T("0.1% Low", "0,1% mínimo") +T("Hitches", "Tirones") +T("Peak VRAM", "VRAM pico") +T("Avg ms", "ms medios") +T("p99 ms", "p99 ms") +T("Max ms", "ms máx") +T("Failed", "Fallido") +T("Overall", "Total") +T("Frame time", "Tiempo de frame") +T("median", "mediana") +T("Copy Markdown report", "Copiar informe Markdown") +T("Copy", "Copiar") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "Copia al portapapeles una tabla Markdown con todas las rutas e información del sistema.") +T("Copied Markdown benchmark report to clipboard.", "Informe Markdown copiado al portapapeles.") +T("Save CSV report", "Guardar informe CSV") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "Guarda las métricas detalladas de cada ruta en un CSV con fecha en la carpeta benchmarks.") +T("Saved CSV", "CSV guardado") +T("Could not save CSV file.", "No se pudo guardar el archivo CSV.") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "Preparando...") +T("Teleporting...", "Teletransportando...") +T("Aiming camera...", "Apuntando cámara...") +T("Warming up...", "Estabilizando...") +T("Measuring...", "Midiendo...") +T("Restoring position...", "Restaurando posición...") +T("Press Esc to cancel", "Pulsa Esc para cancelar") diff --git a/runtime/ui/i18n/fr.inc b/runtime/ui/i18n/fr.inc index 692350e4c..3c7267601 100644 --- a/runtime/ui/i18n/fr.inc +++ b/runtime/ui/i18n/fr.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps jusqu'au prochain F5") T("Frame rate as set again", "Fréquence d'images comme réglée") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps pour une énigme physique, jusqu'au prochain appui : F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "Benchmark") +T("Load a save and enter the world to run the benchmark.", "Chargez une sauvegarde et entrez dans le monde pour lancer le benchmark.") +T("Suite setup", "Configuration") +T("Full suite (7 routes)", "Suite complète (7 routes)") +T("Quick suite (3 routes)", "Suite rapide (3 routes)") +T("Single route", "Route unique") +T("Suite", "Suite") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "La suite complète mesure les 7 vues canoniques d'Hyrule. La suite rapide mesure le Prélude, Cocorico et la forêt Korogu. Position actuelle mesure là où se trouve Link.") +T("Route", "Route") +T("Which fixed camera route to measure.", "Quelle vue de caméra fixe mesurer.") +T("Sample duration", "Durée de mesure") +T("How long each route samples frame times after warming up.", "Durée de capture des temps d'image par route après la chauffe.") +T("Warm-up", "Préchauffage") +T("Settle window after teleporting and aiming before frame capture begins.", "Temps de stabilisation après téléportation et visée avant la mesure.") +T("Uncap FPS and VSync", "Débrider FPS et VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "Désactive temporairement la limite de FPS, la VSync et la génération d'images pendant le test, puis restaure vos réglages.") +T("Start benchmark", "Lancer le benchmark") +T("Running...", "En cours...") +T("Start", "Démarrer") +T("In world only", "En jeu uniquement") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "Exécute la suite choisie et ramène Link à sa position de départ avec les résultats complets.") +T("Benchmark cancelled.", "Benchmark annulé.") +T("Results", "Résultats") +T("Partial results (cancelled early):", "Résultats partiels (annulé) :") +T("Avg FPS", "FPS moy.") +T("1% Low", "1% bas") +T("0.1% Low", "0,1% bas") +T("Hitches", "Saccades") +T("Peak VRAM", "VRAM max") +T("Avg ms", "ms moy.") +T("p99 ms", "p99 ms") +T("Max ms", "ms max") +T("Failed", "Échec") +T("Overall", "Global") +T("Frame time", "Temps d'image") +T("median", "médiane") +T("Copy Markdown report", "Copier le rapport Markdown") +T("Copy", "Copier") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "Copie un tableau récapitulatif Markdown avec les routes et la configuration dans le presse-papiers.") +T("Copied Markdown benchmark report to clipboard.", "Rapport Markdown copié dans le presse-papiers.") +T("Save CSV report", "Enregistrer le rapport CSV") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "Enregistre les mesures détaillées dans un fichier CSV horodaté dans le dossier benchmarks.") +T("Saved CSV", "CSV enregistré") +T("Could not save CSV file.", "Impossible d'enregistrer le fichier CSV.") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "Préparation...") +T("Teleporting...", "Téléportation...") +T("Aiming camera...", "Alignement caméra...") +T("Warming up...", "Préchauffage...") +T("Measuring...", "Mesure en cours...") +T("Restoring position...", "Restauration...") +T("Press Esc to cancel", "Appuyez sur Échap pour annuler") diff --git a/runtime/ui/i18n/he.inc b/runtime/ui/i18n/he.inc index 9939b5ca8..f58b024a6 100644 --- a/runtime/ui/i18n/he.inc +++ b/runtime/ui/i18n/he.inc @@ -1555,3 +1555,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps עד לחיצה נוספת על F5") T("Frame rate as set again", "קצב הפריימים שוב כפי שהוגדר") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps לחידת פיזיקה, עד לחיצה נוספת: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "בנצ׳מרק") +T("Load a save and enter the world to run the benchmark.", "טען שמירה והיכנס לעולם כדי להריץ את הבנצ׳מרק.") +T("Suite setup", "הגדרת בדיקה") +T("Full suite (7 routes)", "בדיקה מלאה (7 מסלולים)") +T("Quick suite (3 routes)", "בדיקה מהירה (3 מסלולים)") +T("Single route", "מסלול יחיד") +T("Suite", "סדרה") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "בדיקה מלאה מודדת את 7 התצפיות הקבועות בהיירול. מהירה מודדת את הרמה, קאקאריקו ויער הקורוק. המיקום הנוכחי מודד איפה שלינק עומד עכשיו.") +T("Route", "מסלול") +T("Which fixed camera route to measure.", "איזה מסלול מצלמה קבוע למדוד.") +T("Sample duration", "משך מדידה") +T("How long each route samples frame times after warming up.", "כמה זמן כל מסלול דוגם זמני פריים לאחר ההתחממות.") +T("Warm-up", "התחממות") +T("Settle window after teleporting and aiming before frame capture begins.", "זמן התייצבות לאחר שיגור וכיוון המצלמה לפני תחילת המדידה.") +T("Uncap FPS and VSync", "הסר הגבלת FPS ו-VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "מכבה זמנית את מגבלת ה-FPS, ה-VSync ויצירת הפריימים בזמן המדידה ומשחזר אותם בסיום.") +T("Start benchmark", "התחל בנצ׳מרק") +T("Running...", "פועל...") +T("Start", "התחל") +T("In world only", "בעולם בלבד") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "מריץ את סדרת הבדיקה שנבחרה ומחזיר את לינק למקום ההתחלה עם תוצאות מלאות.") +T("Benchmark cancelled.", "הבנצ׳מרק בוטל.") +T("Results", "תוצאות") +T("Partial results (cancelled early):", "תוצאות חלקיות (בוטל מוקדם):") +T("Avg FPS", "FPS ממוצע") +T("1% Low", "1% נמוך") +T("0.1% Low", "0.1% נמוך") +T("Hitches", "תקיעות") +T("Peak VRAM", "שיא VRAM") +T("Avg ms", "ms ממוצע") +T("p99 ms", "p99 ms") +T("Max ms", "ms שיא") +T("Failed", "נכשל") +T("Overall", "כולל") +T("Frame time", "זמן פריים") +T("median", "חציון") +T("Copy Markdown report", "העתק דוח Markdown") +T("Copy", "העתק") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "מעתיק ללוח טבלת Markdown מפורטת של כל המסלולים ופרטי המערכת.") +T("Copied Markdown benchmark report to clipboard.", "דוח ה-Markdown הועתק ללוח.") +T("Save CSV report", "שמור דוח CSV") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "שומר מדדים מפורטים לקובץ CSV עם חותמת זמן בתיקיית benchmarks.") +T("Saved CSV", "CSV נשמר") +T("Could not save CSV file.", "לא ניתן לשמור את קובץ ה-CSV.") +T("BENCHMARK", "בנצ׳מרק") +T("Preparing...", "מכין...") +T("Teleporting...", "משגר...") +T("Aiming camera...", "מכוון מצלמה...") +T("Warming up...", "מתחמם...") +T("Measuring...", "מודד...") +T("Restoring position...", "משחזר מיקום...") +T("Press Esc to cancel", "לחץ Esc לביטול") diff --git a/runtime/ui/i18n/it.inc b/runtime/ui/i18n/it.inc index 38b4bfabb..ad10acb88 100644 --- a/runtime/ui/i18n/it.inc +++ b/runtime/ui/i18n/it.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps fino al prossimo F5") T("Frame rate as set again", "Frequenza dei fotogrammi come impostata") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps per un enigma di fisica, finché non la premi di nuovo: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "Benchmark") +T("Load a save and enter the world to run the benchmark.", "Carica un salvataggio ed entra nel mondo per avviare il benchmark.") +T("Suite setup", "Configurazione") +T("Full suite (7 routes)", "Completa (7 percorsi)") +T("Quick suite (3 routes)", "Rapida (3 percorsi)") +T("Single route", "Percorso singolo") +T("Suite", "Serie") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "Completa misura tutte e 7 le visuali canoniche di Hyrule. Rapida misura Altopiano, Calbarico e Bosco dei Korogu. Posizione attuale misura dove si trova Link ora.") +T("Route", "Percorso") +T("Which fixed camera route to measure.", "Quale visuale fissa misurare.") +T("Sample duration", "Durata campionamento") +T("How long each route samples frame times after warming up.", "Per quanto tempo ogni percorso campiona i frame dopo il riscaldamento.") +T("Warm-up", "Riscaldamento") +T("Settle window after teleporting and aiming before frame capture begins.", "Attesa dopo il teletrasporto e il puntamento prima di iniziare a misurare.") +T("Uncap FPS and VSync", "Sblocca FPS e VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "Disattiva temporaneamente limite FPS, VSync e generazione frame durante il test, poi li ripristina.") +T("Start benchmark", "Avvia benchmark") +T("Running...", "In corso...") +T("Start", "Avvia") +T("In world only", "Solo in gioco") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "Esegue il benchmark selezionato e riporta Link alla posizione iniziale con tutti i risultati.") +T("Benchmark cancelled.", "Benchmark annullato.") +T("Results", "Risultati") +T("Partial results (cancelled early):", "Risultati parziali (annullato):") +T("Avg FPS", "FPS medi") +T("1% Low", "1% Low") +T("0.1% Low", "0.1% Low") +T("Hitches", "Micro-scatti") +T("Peak VRAM", "VRAM picco") +T("Avg ms", "ms medi") +T("p99 ms", "p99 ms") +T("Max ms", "Max ms") +T("Failed", "Fallito") +T("Overall", "Totale") +T("Frame time", "Frame time") +T("median", "mediana") +T("Copy Markdown report", "Copia report Markdown") +T("Copy", "Copia") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "Copia negli appunti una tabella Markdown con tutti i percorsi e i dati di sistema.") +T("Copied Markdown benchmark report to clipboard.", "Report Markdown copiato negli appunti.") +T("Save CSV report", "Salva report CSV") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "Salva le metriche dettagliate in un file CSV nella cartella benchmarks.") +T("Saved CSV", "CSV salvato") +T("Could not save CSV file.", "Impossibile salvare il file CSV.") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "Preparazione...") +T("Teleporting...", "Teletrasporto...") +T("Aiming camera...", "Allineo telecamera...") +T("Warming up...", "Riscaldamento...") +T("Measuring...", "Misurazione...") +T("Restoring position...", "Ripristino posizione...") +T("Press Esc to cancel", "Premi Esc per annullare") diff --git a/runtime/ui/i18n/ja.inc b/runtime/ui/i18n/ja.inc index 4175a9400..24feb1858 100644 --- a/runtime/ui/i18n/ja.inc +++ b/runtime/ui/i18n/ja.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "もう一度F5を押すまで30fps") T("Frame rate as set again", "フレームレートを設定どおりに戻しました") T("30 fps for a physics puzzle, until pressed again: F5", "物理パズル用に30fps(もう一度押すまで): F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "ベンチマーク") +T("Load a save and enter the world to run the benchmark.", "セーブデータを読み込んでゲーム世界に入るとベンチマークを実行できます。") +T("Suite setup", "テスト設定") +T("Full suite (7 routes)", "フル (7ルート)") +T("Quick suite (3 routes)", "クイック (3ルート)") +T("Single route", "単一ルート") +T("Suite", "テスト種別") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "フルはハイラル各地の7つの定点シーンを計測します。クイックは始まりの台地・カカリコ村・コログの森を計測します。現在地は今のリンクの位置のまま計測します。") +T("Route", "ルート") +T("Which fixed camera route to measure.", "計測する固定カメラシーンを選びます。") +T("Sample duration", "計測時間") +T("How long each route samples frame times after warming up.", "ウォームアップ後、各ルートでフレーム時間を記録する秒数です。") +T("Warm-up", "ウォームアップ") +T("Settle window after teleporting and aiming before frame capture begins.", "テレポートとカメラ設定の後、計測開始までの待機時間です。") +T("Uncap FPS and VSync", "FPS上限・VSyncを解除") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "計測中のみFPS上限・VSync・フレーム生成を一時的にオフにし、終了後に元へ戻します。") +T("Start benchmark", "ベンチマーク開始") +T("Running...", "実行中...") +T("Start", "開始") +T("In world only", "ゲーム世界のみ") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "選択したテストを実行し、終了後にリンクを元の位置へ戻して結果を表示します。") +T("Benchmark cancelled.", "ベンチマークを中止しました。") +T("Results", "結果") +T("Partial results (cancelled early):", "途中結果(中断):") +T("Avg FPS", "平均FPS") +T("1% Low", "1% Low") +T("0.1% Low", "0.1% Low") +T("Hitches", "ヒッチ") +T("Peak VRAM", "最大VRAM") +T("Avg ms", "平均ms") +T("p99 ms", "p99 ms") +T("Max ms", "最大ms") +T("Failed", "失敗") +T("Overall", "総合") +T("Frame time", "フレーム時間") +T("median", "中央値") +T("Copy Markdown report", "Markdownレポートをコピー") +T("Copy", "コピー") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "全ルートとシステム情報のMarkdown集計表をクリップボードにコピーします。") +T("Copied Markdown benchmark report to clipboard.", "Markdownレポートをクリップボードにコピーしました。") +T("Save CSV report", "CSVレポートを保存") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "各ルートの詳細データをbenchmarksフォルダ内の日時付きCSVファイルに保存します。") +T("Saved CSV", "CSVを保存") +T("Could not save CSV file.", "CSVファイルを保存できませんでした。") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "準備中...") +T("Teleporting...", "テレポート中...") +T("Aiming camera...", "カメラ調整中...") +T("Warming up...", "ウォームアップ中...") +T("Measuring...", "計測中...") +T("Restoring position...", "元の位置に戻しています...") +T("Press Esc to cancel", "Escキーで中止") diff --git a/runtime/ui/i18n/ko.inc b/runtime/ui/i18n/ko.inc index 83e7fdacc..c3643e9df 100644 --- a/runtime/ui/i18n/ko.inc +++ b/runtime/ui/i18n/ko.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "F5를 다시 누를 때까지 30fps") T("Frame rate as set again", "프레임 속도를 설정대로 되돌렸습니다") T("30 fps for a physics puzzle, until pressed again: F5", "물리 퍼즐용 30fps, 다시 누를 때까지: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "벤치마크") +T("Load a save and enter the world to run the benchmark.", "저장 데이터를 불러와 월드에 진입하면 벤치마크를 실행할 수 있습니다.") +T("Suite setup", "테스트 설정") +T("Full suite (7 routes)", "전체 (7개 경로)") +T("Quick suite (3 routes)", "빠른 (3개 경로)") +T("Single route", "단일 경로") +T("Suite", "모드") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "전체는 하이랄 전역의 7개 고정 시점을 측정합니다. 빠른 모드는 시작의 대지, 카카리코 마을, 코로그의 숲을 측정합니다. 현재 위치는 지금 링크가 서 있는 곳에서 측정합니다.") +T("Route", "경로") +T("Which fixed camera route to measure.", "측정할 고정 카메라 경로를 선택합니다.") +T("Sample duration", "측정 시간") +T("How long each route samples frame times after warming up.", "예열 후 각 경로에서 프레임 시간을 측정하는 시간입니다.") +T("Warm-up", "예열") +T("Settle window after teleporting and aiming before frame capture begins.", "텔레포트와 카메라 정렬 후 측정 시작 전 안정화 시간입니다.") +T("Uncap FPS and VSync", "FPS 제한 및 VSync 해제") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "측정 중 FPS 제한, VSync 및 프레임 생성을 일시적으로 끄고 완료 후 복원합니다.") +T("Start benchmark", "벤치마크 시작") +T("Running...", "실행 중...") +T("Start", "시작") +T("In world only", "월드에서만 가능") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "선택한 벤치마크를 실행한 뒤 링크를 원래 위치로 되돌리고 전체 결과를 표시합니다.") +T("Benchmark cancelled.", "벤치마크가 취소되었습니다.") +T("Results", "결과") +T("Partial results (cancelled early):", "부분 결과 (중단됨):") +T("Avg FPS", "평균 FPS") +T("1% Low", "하위 1%") +T("0.1% Low", "하위 0.1%") +T("Hitches", "끊김") +T("Peak VRAM", "최대 VRAM") +T("Avg ms", "평균 ms") +T("p99 ms", "p99 ms") +T("Max ms", "최대 ms") +T("Failed", "실패") +T("Overall", "전체") +T("Frame time", "프레임 시간") +T("median", "중앙값") +T("Copy Markdown report", "Markdown 보고서 복사") +T("Copy", "복사") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "모든 경로와 시스템 정보의 Markdown 요약 표를 클립보드에 복사합니다.") +T("Copied Markdown benchmark report to clipboard.", "Markdown 벤치마크 보고서를 클립보드에 복사했습니다.") +T("Save CSV report", "CSV 보고서 저장") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "각 경로별 상세 수치를 benchmarks 폴더의 타임스탬프 CSV 파일로 저장합니다.") +T("Saved CSV", "CSV 저장됨") +T("Could not save CSV file.", "CSV 파일을 저장할 수 없습니다.") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "준비 중...") +T("Teleporting...", "텔레포트 중...") +T("Aiming camera...", "카메라 정렬 중...") +T("Warming up...", "예열 중...") +T("Measuring...", "측정 중...") +T("Restoring position...", "원래 위치로 복귀 중...") +T("Press Esc to cancel", "Esc 키를 눌러 취소") diff --git a/runtime/ui/i18n/nl.inc b/runtime/ui/i18n/nl.inc index dc0c934dc..3626d2ecd 100644 --- a/runtime/ui/i18n/nl.inc +++ b/runtime/ui/i18n/nl.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps tot je weer op F5 drukt") T("Frame rate as set again", "Framerate weer zoals ingesteld") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps voor een natuurkundepuzzel, tot je opnieuw drukt: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "Benchmark") +T("Load a save and enter the world to run the benchmark.", "Laad een save en ga de wereld in om de benchmark te starten.") +T("Suite setup", "Testinstellingen") +T("Full suite (7 routes)", "Volledig (7 routes)") +T("Quick suite (3 routes)", "Snel (3 routes)") +T("Single route", "Enkele route") +T("Suite", "Reeks") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "Volledig meet alle 7 vaste plekken in Hyrule. Snel meet Plateau, Kakariko en Korok Forest. Huidige plek meet waar Link nu staat.") +T("Route", "Route") +T("Which fixed camera route to measure.", "Welke vaste camera-route gemeten wordt.") +T("Sample duration", "Meetduur") +T("How long each route samples frame times after warming up.", "Hoe lang elke route frametijden meet na het opwarmen.") +T("Warm-up", "Opwarmen") +T("Settle window after teleporting and aiming before frame capture begins.", "Wachttijd na teleporteren en richten voordat de meting begint.") +T("Uncap FPS and VSync", "Ontgrendel FPS en VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "Schakelt FPS-limiet, VSync en framegeneratie tijdelijk uit tijdens de meting en herstelt ze daarna.") +T("Start benchmark", "Benchmark starten") +T("Running...", "Bezig...") +T("Start", "Start") +T("In world only", "Alleen in het spel") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "Voert de gekozen benchmarkreeks uit en zet Link met alle resultaten weer terug.") +T("Benchmark cancelled.", "Benchmark geannuleerd.") +T("Results", "Resultaten") +T("Partial results (cancelled early):", "Deelresultaten (afgebroken):") +T("Avg FPS", "Gem. FPS") +T("1% Low", "1% Low") +T("0.1% Low", "0.1% Low") +T("Hitches", "Haperingen") +T("Peak VRAM", "Piek-VRAM") +T("Avg ms", "Gem. ms") +T("p99 ms", "p99 ms") +T("Max ms", "Max ms") +T("Failed", "Mislukt") +T("Overall", "Totaal") +T("Frame time", "Frametijd") +T("median", "mediaan") +T("Copy Markdown report", "Markdown-rapport kopiëren") +T("Copy", "Kopiëren") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "Kopieert een opgemaakte Markdown-samenvatting naar het klembord.") +T("Copied Markdown benchmark report to clipboard.", "Markdown-rapport gekopieerd naar klembord.") +T("Save CSV report", "CSV-rapport opslaan") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "Slaat gedetailleerde metingen op in een CSV-bestand in de map benchmarks.") +T("Saved CSV", "CSV opgeslagen") +T("Could not save CSV file.", "Kan CSV-bestand niet opslaan.") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "Voorbereiden...") +T("Teleporting...", "Teleporteren...") +T("Aiming camera...", "Camera richten...") +T("Warming up...", "Opwarmen...") +T("Measuring...", "Meten...") +T("Restoring position...", "Positie herstellen...") +T("Press Esc to cancel", "Druk op Esc om te annuleren") diff --git a/runtime/ui/i18n/pt.inc b/runtime/ui/i18n/pt.inc index 0b7dc092c..a69cf82be 100644 --- a/runtime/ui/i18n/pt.inc +++ b/runtime/ui/i18n/pt.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps até apertar F5 de novo") T("Frame rate as set again", "Taxa de quadros como configurada") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps para um quebra-cabeça de física, até apertar de novo: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "Benchmark") +T("Load a save and enter the world to run the benchmark.", "Carregue um jogo salvo e entre no mundo para executar o benchmark.") +T("Suite setup", "Configuração do teste") +T("Full suite (7 routes)", "Completa (7 rotas)") +T("Quick suite (3 routes)", "Rápida (3 rotas)") +T("Single route", "Rota única") +T("Suite", "Série") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "Completa mede todas as 7 vistas canônicas de Hyrule. Rápida mede o Platô, Kakariko e a Floresta Korok. Local atual mede onde Link está agora.") +T("Route", "Rota") +T("Which fixed camera route to measure.", "Qual vista de câmera fixa medir.") +T("Sample duration", "Duração da amostra") +T("How long each route samples frame times after warming up.", "Por quanto tempo cada rota registra os tempos de quadro após o aquecimento.") +T("Warm-up", "Aquecimento") +T("Settle window after teleporting and aiming before frame capture begins.", "Tempo de estabilização após teleportar e alinhar a câmera antes de medir.") +T("Uncap FPS and VSync", "Destravar FPS e VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "Desativa temporariamente o limite de FPS, VSync e geração de quadros durante o teste e restaura depois.") +T("Start benchmark", "Iniciar benchmark") +T("Running...", "Em andamento...") +T("Start", "Iniciar") +T("In world only", "Apenas no mundo") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "Executa o benchmark selecionado e retorna Link à posição inicial com os resultados completos.") +T("Benchmark cancelled.", "Benchmark cancelado.") +T("Results", "Resultados") +T("Partial results (cancelled early):", "Resultados parciais (cancelado):") +T("Avg FPS", "FPS médios") +T("1% Low", "1% Low") +T("0.1% Low", "0.1% Low") +T("Hitches", "Engasgos") +T("Peak VRAM", "Pico VRAM") +T("Avg ms", "ms médios") +T("p99 ms", "p99 ms") +T("Max ms", "ms máx") +T("Failed", "Falhou") +T("Overall", "Geral") +T("Frame time", "Tempo de quadro") +T("median", "mediana") +T("Copy Markdown report", "Copiar relatório Markdown") +T("Copy", "Copiar") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "Copia uma tabela Markdown com todas as rotas e informações do sistema para a área de transferência.") +T("Copied Markdown benchmark report to clipboard.", "Relatório Markdown copiado para a área de transferência.") +T("Save CSV report", "Salvar relatório CSV") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "Salva as métricas detalhadas em um arquivo CSV com data na pasta benchmarks.") +T("Saved CSV", "CSV salvo") +T("Could not save CSV file.", "Não foi possível salvar o arquivo CSV.") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "Preparando...") +T("Teleporting...", "Teleportando...") +T("Aiming camera...", "Alinhando câmera...") +T("Warming up...", "Aquecendo...") +T("Measuring...", "Medindo...") +T("Restoring position...", "Restaurando posição...") +T("Press Esc to cancel", "Pressione Esc para cancelar") diff --git a/runtime/ui/i18n/ru.inc b/runtime/ui/i18n/ru.inc index da69aecb0..b4c244144 100644 --- a/runtime/ui/i18n/ru.inc +++ b/runtime/ui/i18n/ru.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 кадров/с до следующего нажатия F5") T("Frame rate as set again", "Частота кадров снова как в настройках") T("30 fps for a physics puzzle, until pressed again: F5", "30 кадров/с для физической головоломки, до повторного нажатия: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "Бенчмарк") +T("Load a save and enter the world to run the benchmark.", "Загрузите сохранение и войдите в мир, чтобы запустить бенчмарк.") +T("Suite setup", "Параметры теста") +T("Full suite (7 routes)", "Полный (7 сцен)") +T("Quick suite (3 routes)", "Быстрый (3 сцены)") +T("Single route", "Одна сцена") +T("Suite", "Режим") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "Полный режим измеряет все 7 эталонных сцен Хайрула. Быстрый — Плато, Какарико и Лес Короков. Текущее место измеряет там, где сейчас стоит Линк.") +T("Route", "Сцена") +T("Which fixed camera route to measure.", "Какую фиксированную сцену измерить.") +T("Sample duration", "Длительность замера") +T("How long each route samples frame times after warming up.", "Сколько секунд каждая сцена записывает время кадров после прогрева.") +T("Warm-up", "Прогрев") +T("Settle window after teleporting and aiming before frame capture begins.", "Пауза после телепорта и наведения камеры перед началом записи.") +T("Uncap FPS and VSync", "Снять лимит FPS и VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "На время замера отключает ограничение FPS, VSync и генерацию кадров, а затем возвращает настройки.") +T("Start benchmark", "Запустить бенчмарк") +T("Running...", "Выполняется...") +T("Start", "Старт") +T("In world only", "Только в мире") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "Запускает выбранный набор сцен и возвращает Линка на исходную позицию с результатами.") +T("Benchmark cancelled.", "Бенчмарк отменён.") +T("Results", "Результаты") +T("Partial results (cancelled early):", "Частичные результаты (прервано):") +T("Avg FPS", "Сред. FPS") +T("1% Low", "1% мин.") +T("0.1% Low", "0.1% мин.") +T("Hitches", "Статтеры") +T("Peak VRAM", "Пик VRAM") +T("Avg ms", "Сред. мс") +T("p99 ms", "p99 мс") +T("Max ms", "Макс. мс") +T("Failed", "Ошибка") +T("Overall", "Итого") +T("Frame time", "Время кадра") +T("median", "медиана") +T("Copy Markdown report", "Копировать отчёт Markdown") +T("Copy", "Копировать") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "Копирует форматированную Markdown-таблицу со всеми сценами и параметрами в буфер обмена.") +T("Copied Markdown benchmark report to clipboard.", "Отчёт Markdown скопирован в буфер обмена.") +T("Save CSV report", "Сохранить отчёт CSV") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "Сохраняет подробные показатели по сценам в CSV-файл в папке benchmarks.") +T("Saved CSV", "CSV сохранён") +T("Could not save CSV file.", "Не удалось сохранить CSV-файл.") +T("BENCHMARK", "БЕНЧМАРК") +T("Preparing...", "Подготовка...") +T("Teleporting...", "Телепортация...") +T("Aiming camera...", "Наведение камеры...") +T("Warming up...", "Прогрев...") +T("Measuring...", "Замер...") +T("Restoring position...", "Возврат на позицию...") +T("Press Esc to cancel", "Нажмите Esc для отмены") diff --git a/runtime/ui/i18n/th.inc b/runtime/ui/i18n/th.inc index 3f5faf9d0..50d9053b1 100644 --- a/runtime/ui/i18n/th.inc +++ b/runtime/ui/i18n/th.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps จนกว่าจะกด F5 อีกครั้ง") T("Frame rate as set again", "อัตราเฟรมกลับเป็นตามที่ตั้งไว้") T("30 fps for a physics puzzle, until pressed again: F5", "30 fps สำหรับปริศนาฟิสิกส์ จนกว่าจะกดอีกครั้ง: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "ทดสอบประสิทธิภาพ") +T("Load a save and enter the world to run the benchmark.", "โหลดเซฟแล้วเข้าสู่โลกเพื่อเริ่มการทดสอบประสิทธิภาพ") +T("Suite setup", "ตั้งค่าการทดสอบ") +T("Full suite (7 routes)", "ชุดเต็ม (7 จุด)") +T("Quick suite (3 routes)", "ชุดด่วน (3 จุด)") +T("Single route", "จุดเดียว") +T("Suite", "ชุดทดสอบ") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "ชุดเต็มวัดทั้ง 7 จุดมาตรฐานทั่วไฮรูล ชุดด่วนวัด Plateau, Kakariko และ Korok Forest ตำแหน่งปัจจุบันวัดตรงที่ลิงก์ยืนอยู่ตอนนี้") +T("Route", "จุด") +T("Which fixed camera route to measure.", "เลือกว่าจะวัดจุดกล้องคงที่ใด") +T("Sample duration", "ระยะเวลาวัด") +T("How long each route samples frame times after warming up.", "ระยะเวลาที่แต่ละจุดบันทึกค่าเฟรมไทม์หลังช่วงอุ่นเครื่อง") +T("Warm-up", "อุ่นเครื่อง") +T("Settle window after teleporting and aiming before frame capture begins.", "ช่วงรอให้ฉากนิ่งหลังเทเลพอร์ตและตั้งกล้องก่อนเริ่มบันทึกค่า") +T("Uncap FPS and VSync", "ปลดล็อก FPS และ VSync") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "ปิดการจำกัด FPS, VSync และ Frame generation ชั่วคราวระหว่างวัด แล้วคืนค่าเดิมเมื่อเสร็จสิ้น") +T("Start benchmark", "เริ่มทดสอบประสิทธิภาพ") +T("Running...", "กำลังทำงาน...") +T("Start", "เริ่ม") +T("In world only", "เฉพาะในโลกเกม") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "รันชุดทดสอบที่เลือก แล้วพาลิงก์กลับมาจุดเริ่มต้นพร้อมผลลัพธ์ทั้งหมด") +T("Benchmark cancelled.", "ยกเลิกการทดสอบแล้ว") +T("Results", "ผลลัพธ์") +T("Partial results (cancelled early):", "ผลลัพธ์บางส่วน (ถูกยกเลิก):") +T("Avg FPS", "FPS เฉลี่ย") +T("1% Low", "1% Low") +T("0.1% Low", "0.1% Low") +T("Hitches", "อาการสะดุด") +T("Peak VRAM", "VRAM สูงสุด") +T("Avg ms", "ms เฉลี่ย") +T("p99 ms", "p99 ms") +T("Max ms", "ms สูงสุด") +T("Failed", "ล้มเหลว") +T("Overall", "ภาพรวม") +T("Frame time", "เฟรมไทม์") +T("median", "มัธยฐาน") +T("Copy Markdown report", "คัดลอกรายงาน Markdown") +T("Copy", "คัดลอก") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "คัดลอกตารางสรุปแบบ Markdown ของทุกจุดและข้อมูลระบบไปยังคลิปบอร์ด") +T("Copied Markdown benchmark report to clipboard.", "คัดลอกรายงาน Markdown ไปยังคลิปบอร์ดแล้ว") +T("Save CSV report", "บันทึกรายงาน CSV") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "บันทึกรายละเอียดแต่ละจุดเป็นไฟล์ CSV ลงในโฟลเดอร์ benchmarks") +T("Saved CSV", "บันทึก CSV แล้ว") +T("Could not save CSV file.", "ไม่สามารถบันทึกไฟล์ CSV ได้") +T("BENCHMARK", "BENCHMARK") +T("Preparing...", "กำลังเตรียม...") +T("Teleporting...", "กำลังเทเลพอร์ต...") +T("Aiming camera...", "กำลังตั้งกล้อง...") +T("Warming up...", "กำลังอุ่นเครื่อง...") +T("Measuring...", "กำลังวัดผล...") +T("Restoring position...", "กำลังคืนตำแหน่ง...") +T("Press Esc to cancel", "กด Esc เพื่อยกเลิก") diff --git a/runtime/ui/i18n/zh-Hans.inc b/runtime/ui/i18n/zh-Hans.inc index 01fa0d680..956509ccb 100644 --- a/runtime/ui/i18n/zh-Hans.inc +++ b/runtime/ui/i18n/zh-Hans.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps,直到再次按 F5") T("Frame rate as set again", "帧率恢复为设置值") T("30 fps for a physics puzzle, until pressed again: F5", "物理谜题时 30 fps,再按一次恢复: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "基准测试") +T("Load a save and enter the world to run the benchmark.", "读取存档并进入游戏世界后即可运行基准测试。") +T("Suite setup", "测试设置") +T("Full suite (7 routes)", "完整套件 (7 条路线)") +T("Quick suite (3 routes)", "快速套件 (3 条路线)") +T("Single route", "单条路线") +T("Suite", "测试模式") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "完整套件将测量海拉鲁全部 7 个标准视角;快速套件测量初始台地、卡卡利科村与克洛格森林;当前位置则直接原地采样。") +T("Route", "路线") +T("Which fixed camera route to measure.", "选择要测量的固定机位路线。") +T("Sample duration", "采样时长") +T("How long each route samples frame times after warming up.", "预热完成后每条路线采样帧时间的时长。") +T("Warm-up", "预热时间") +T("Settle window after teleporting and aiming before frame capture begins.", "传送并调整视角后开始采样前的稳定等待时间。") +T("Uncap FPS and VSync", "解除帧率上限与垂直同步") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "测量期间临时关闭帧率限制、垂直同步与帧生成,结束后自动恢复原设置。") +T("Start benchmark", "开始基准测试") +T("Running...", "运行中...") +T("Start", "开始") +T("In world only", "仅限游戏世界内") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "运行所选基准测试,并在完成后将林克送回原位置并显示完整结果。") +T("Benchmark cancelled.", "基准测试已取消。") +T("Results", "测试结果") +T("Partial results (cancelled early):", "部分结果(提前取消):") +T("Avg FPS", "平均帧率") +T("1% Low", "1% 低帧") +T("0.1% Low", "0.1% 低帧") +T("Hitches", "卡顿次数") +T("Peak VRAM", "显存峰值") +T("Avg ms", "平均帧时") +T("p99 ms", "p99 帧时") +T("Max ms", "最大帧时") +T("Failed", "失败") +T("Overall", "总计") +T("Frame time", "帧时间") +T("median", "中位数") +T("Copy Markdown report", "复制 Markdown 报告") +T("Copy", "复制") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "将包含所有路线与系统信息的 Markdown 汇总表格复制到剪贴板。") +T("Copied Markdown benchmark report to clipboard.", "已将 Markdown 基准测试报告复制到剪贴板。") +T("Save CSV report", "保存 CSV 报告") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "将各路线的详细指标保存到 benchmarks 文件夹中带时间戳的 CSV 文件。") +T("Saved CSV", "已保存 CSV") +T("Could not save CSV file.", "无法保存 CSV 文件。") +T("BENCHMARK", "基准测试") +T("Preparing...", "准备中...") +T("Teleporting...", "传送中...") +T("Aiming camera...", "调整视角中...") +T("Warming up...", "预热中...") +T("Measuring...", "测量中...") +T("Restoring position...", "恢复位置中...") +T("Press Esc to cancel", "按 Esc 取消") diff --git a/runtime/ui/i18n/zh-Hant.inc b/runtime/ui/i18n/zh-Hant.inc index cd6907c68..baf1b5b33 100644 --- a/runtime/ui/i18n/zh-Hant.inc +++ b/runtime/ui/i18n/zh-Hant.inc @@ -1556,3 +1556,62 @@ T("Press the sprint button once while moving and Link keeps sprinting until he s T("30 fps until F5 again", "30 fps,直到再次按 F5") T("Frame rate as set again", "影格率恢復為設定值") T("30 fps for a physics puzzle, until pressed again: F5", "物理謎題時 30 fps,再按一次恢復: F5") +T("30 FPS (33.3 ms)", "") +T("60 FPS (16.7 ms)", "") +T("120 FPS (8.3 ms)", "") +T("%.0f MB", "") +T("%s | %dx%d | %s", "") +T("%s: %s (%.1f - %.1f ms, %s %.2f ms)", "") +T("%.0f FPS %.1f ms", "") +T("Benchmark", "基準測試") +T("Load a save and enter the world to run the benchmark.", "讀取存檔並進入遊戲世界後即可執行基準測試。") +T("Suite setup", "測試設定") +T("Full suite (7 routes)", "完整套件 (7 條路線)") +T("Quick suite (3 routes)", "快速套件 (3 條路線)") +T("Single route", "單條路線") +T("Suite", "測試模式") +T("Full suite runs all 7 canonical views across Hyrule. Quick suite measures Plateau, Kakariko and Korok Forest. Current spot samples where Link is standing now.", "完整套件將測量海拉魯全部 7 個標準視角;快速套件測量初始台地、卡卡利科村與克洛格森林;目前位置則直接原地採樣。") +T("Route", "路線") +T("Which fixed camera route to measure.", "選擇要測量的固定機位路線。") +T("Sample duration", "取樣時長") +T("How long each route samples frame times after warming up.", "預熱完成後每條路線取樣幀時間的時長。") +T("Warm-up", "預熱時間") +T("Settle window after teleporting and aiming before frame capture begins.", "傳送並調整視角後開始取樣前的穩定等待時間。") +T("Uncap FPS and VSync", "解除幀率上限與垂直同步") +T("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.", "測量期間暫時關閉幀率限制、垂直同步與影格生成,結束後自動恢復原設定。") +T("Start benchmark", "開始基準測試") +T("Running...", "執行中...") +T("Start", "開始") +T("In world only", "僅限遊戲世界內") +T("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results.", "執行所選基準測試,並在完成後將林克送回原位置並顯示完整結果。") +T("Benchmark cancelled.", "基準測試已取消。") +T("Results", "測試結果") +T("Partial results (cancelled early):", "部分結果(提前取消):") +T("Avg FPS", "平均幀率") +T("1% Low", "1% 低幀") +T("0.1% Low", "0.1% 低幀") +T("Hitches", "卡頓次數") +T("Peak VRAM", "顯存峰值") +T("Avg ms", "平均幀時") +T("p99 ms", "p99 幀時") +T("Max ms", "最大幀時") +T("Failed", "失敗") +T("Overall", "總計") +T("Frame time", "幀時間") +T("median", "中位數") +T("Copy Markdown report", "複製 Markdown 報告") +T("Copy", "複製") +T("Copies a formatted Markdown summary table of all benchmark routes and system info to the clipboard.", "將包含所有路線與系統資訊的 Markdown 彙總表格複製到剪貼簿。") +T("Copied Markdown benchmark report to clipboard.", "已將 Markdown 基準測試報告複製到剪貼簿。") +T("Save CSV report", "儲存 CSV 報告") +T("Saves detailed per-route metrics to a timestamped CSV file inside the benchmarks folder.", "將各路線的詳細指標儲存到 benchmarks 資料夾中帶時間戳記的 CSV 檔案。") +T("Saved CSV", "已儲存 CSV") +T("Could not save CSV file.", "無法儲存 CSV 檔案。") +T("BENCHMARK", "基準測試") +T("Preparing...", "準備中...") +T("Teleporting...", "傳送中...") +T("Aiming camera...", "調整視角中...") +T("Warming up...", "預熱中...") +T("Measuring...", "測量中...") +T("Restoring position...", "恢復位置中...") +T("Press Esc to cancel", "按 Esc 取消") diff --git a/runtime/ui/menu.mm b/runtime/ui/menu.mm index bdcf2a63a..667ac7cb3 100644 --- a/runtime/ui/menu.mm +++ b/runtime/ui/menu.mm @@ -25,6 +25,7 @@ #include "imgui_internal.h" // (NavCursorVisible) #include "osk.h" #include "console.h" +#include "benchmark_ui.h" #ifdef SW_METAL #include "imgui_impl_metal.h" #else @@ -37,6 +38,7 @@ extern "C" { #include "../amiibo.h" +#include "../benchmark.h" #include "../bookmarks.h" #include "../collectibles.h" #include "../control.h" @@ -330,6 +332,12 @@ bool menu_handle_event(const SDL_Event *e) { } // typing (a text field, the on-screen keyboard, the name entry): keys are text, not menu shortcuts bool typing = g_kbd.load() == 1 || console_is_open() || (g_open.load() && g_text_busy.load()); + if (!g_open.load() && !console_is_open() && bench_active() && + ((e->type == SDL_EVENT_KEY_DOWN && !e->key.repeat && e->key.scancode == SDL_SCANCODE_ESCAPE) || + (e->type == SDL_EVENT_GAMEPAD_BUTTON_DOWN && e->gbutton.button == g_bind_pad[BIND_B]))) { + bench_cancel(); + return true; + } if (e->type == SDL_EVENT_KEY_UP && e->key.scancode == SDL_SCANCODE_ESCAPE) input_pc_escape(false); if (pc_cursor_enabled() && !capturing() && !typing && !game_options_input_hold() && @@ -2972,6 +2980,7 @@ static void size_list_draw(ImGuiIO &io, float scale) { case 11: return "Teleport"; case 12: return "Mods"; case 13: return "Achievements"; + case 15: return "Benchmark"; } return ""; } @@ -2993,6 +3002,7 @@ static int game_pages(UiNavPage *out) { int n = 0; out[n++] = {12, "Mods", ICON_PUZZLE, 0, true}; out[n++] = {13, "Achievements", ICON_TROPHY, 0, true}; // (runtime/ui/achievements_ui.mm) + out[n++] = {15, "Benchmark", ICON_SLIDERS, 0, true}; // (runtime/ui/benchmark_ui.mm) // (Cheats, Teleport: only when started with -dev or SAVAGEWIND_DEV=1: cheats are developer mode, as the // console's give, tp and time) if (control_enabled()) out[n++] = {10, "Cheats", ICON_MAGIC, 0, true}, out[n++] = {11, "Teleport", ICON_LOCATION, 0, true}; @@ -3021,6 +3031,12 @@ static void page_body(int id, float scale, bool in_game) { case 10: tab_cheats(); break; case 11: tab_teleport(); break; case 13: ach_ui_tab(); break; + case 15: { + bool close = false; + bench_ui_tab(&close); + if (close) set_open(false); + break; + } case 12: { bool want_restart = false; mods_tab_draw(in_game, &want_restart); @@ -3255,7 +3271,7 @@ static bool menu_draws(bool *pointer_hover = NULL, float *pointer_box = NULL, bo if (gyro_show) *gyro_show = gyro_on; return g_open.load() || g_kbd.load() == 1 || g_sizes.load() || console_is_open() || gyro_on || hover || g_settings.perf_overlay != PERF_OFF || act_log_enabled() || quick_inventory_sort_hint() || quick_drop_hint_state() || - collect_map_shown() || ach_ui_active() || SDL_GetTicks() < g_notice_until.load(); + collect_map_shown() || ach_ui_active() || bench_hud_visible() || SDL_GetTicks() < g_notice_until.load(); } bool menu_render_needed(void) { return menu_draws(); } @@ -3341,6 +3357,7 @@ void menu_render(void *cmd, uint32_t target_w, uint32_t target_h) { } if (g_settings.perf_overlay != PERF_OFF) perf_overlay_draw(io, scale); + if (!open && !kbd && !sizes && !con && bench_hud_visible()) bench_ui_overlay(io.DisplaySize.x, io.DisplaySize.y, scale); ach_ui_toasts(io.DisplaySize.x, io.DisplaySize.y, scale); notice_draw(io, scale); if (act_log_enabled()) act_overlay_draw(io, scale); diff --git a/tests/test_benchmark.c b/tests/test_benchmark.c new file mode 100644 index 000000000..801f8227b --- /dev/null +++ b/tests/test_benchmark.c @@ -0,0 +1,103 @@ +// Standalone unit tests for runtime/benchmark.c (stats, percentiles, 1%/0.1% lows, hitches, sparkline, markdown). +#define BENCH_STATS_ONLY +#include +#include +#include +#include + +#include "../runtime/benchmark.c" + +static int near_d(double a, double b, double tol) { return fabs(a - b) <= tol; } + +static void test_steady_60fps(void) { + uint32_t us[600]; + for (int i = 0; i < 600; i++) us[i] = 16667; + BenchRouteStats st = {0}; + snprintf(st.id, sizeof st.id, "plateau"); + snprintf(st.name, sizeof st.name, "Great Plateau"); + bench_compute_stats(us, 600, 10.0, &st); + assert(st.valid && !st.failed); + assert(st.frames == 600); + assert(near_d(st.avg_fps, 60.0, 0.05)); + assert(near_d(st.low_1pct_fps, 60.0, 0.05)); + assert(near_d(st.low_01pct_fps, 60.0, 0.05)); + assert(near_d(st.median_ms, 16.667, 0.01)); + assert(near_d(st.p99_ms, 16.667, 0.01)); + assert(st.hitches == 0); + assert(st.spark_n == BENCH_SPARK_LEN); +} + +static void test_spikes_and_hitches(void) { + // 1000 frames: 988 at 10.0 ms (100 fps), 10 at 40.0 ms, 2 at 100.0 ms + uint32_t us[1000]; + for (int i = 0; i < 1000; i++) us[i] = 10000; + for (int i = 0; i < 10; i++) us[100 + i * 50] = 40000; + us[251] = 100000; + us[751] = 100000; + + BenchRouteStats st = {0}; + snprintf(st.id, sizeof st.id, "korok"); + snprintf(st.name, sizeof st.name, "Korok Forest"); + st.vram_peak_mb = 2450.0f; + bench_compute_stats(us, 1000, 10.48, &st); + assert(st.valid); + assert(near_d(st.median_ms, 10.0, 0.01)); + assert(near_d(st.min_ms, 10.0, 0.01)); + assert(near_d(st.max_ms, 100.0, 0.01)); + assert(st.p99_ms >= 39.9 && st.p99_ms <= 41.0); + // 1% low (slowest 10 frames): 8 * 40 ms + 2 * 100 ms = 520 ms / 10 = 52 ms => 19.23 fps + assert(near_d(st.low_1pct_fps, 1000.0 / 52.0, 0.1)); + // 0.1% low (slowest 1 frame): 100 ms => 10.0 fps + assert(near_d(st.low_01pct_fps, 10.0, 0.1)); + // Hitches: threshold is max(2 * 10 = 20, 33.333) = 33.333 ms => 10 + 2 = 12 hitches + assert(st.hitches == 12); + // Metadata preserved + assert(near_d(st.vram_peak_mb, 2450.0, 0.01)); + // Max downsampling must preserve the 100 ms spikes in the sparkline + float max_spark = 0.0f; + for (int i = 0; i < st.spark_n; i++) + if (st.spark_ms[i] > max_spark) max_spark = st.spark_ms[i]; + assert(near_d(max_spark, 100.0, 0.01)); +} + +static void test_markdown_and_routes(void) { + assert(bench_route_count() == BENCH_ROUTE_COUNT); + for (int i = 0; i < BENCH_ROUTE_COUNT; i++) { + const BenchRouteInfo *r = bench_route_info(i); + assert(r && r->id && r->name); + } + assert(bench_route_info(-1) == NULL); + assert(bench_route_info(BENCH_ROUTE_COUNT) == NULL); + + uint32_t us[120]; + for (int i = 0; i < 120; i++) us[i] = 8333; + BenchSnapshot snap = {0}; + snprintf(snap.gpu_name, sizeof snap.gpu_name, "NVIDIA GeForce RTX 3050"); + snprintf(snap.cpu_name, sizeof snap.cpu_name, "AMD Ryzen 7"); + snap.width = 1920; + snap.height = 1080; + snprintf(snap.settings_summary, sizeof snap.settings_summary, "Upscaler: Off | AA: TAA"); + snap.has_results = true; + snap.nresults = 1; + snprintf(snap.results[0].id, sizeof snap.results[0].id, "plateau"); + snprintf(snap.results[0].name, sizeof snap.results[0].name, "Great Plateau"); + snap.results[0].vram_peak_mb = 1800.0f; + bench_compute_stats(us, 120, 1.0, &snap.results[0]); + snap.overall = snap.results[0]; + + char md[4096]; + size_t len = bench_format_markdown(&snap, md, sizeof md); + assert(len > 0 && len < sizeof md); + assert(strstr(md, "## Savage Wind Benchmark") != NULL); + assert(strstr(md, "NVIDIA GeForce RTX 3050") != NULL); + assert(strstr(md, "| Great Plateau | 120.0 |") != NULL); + assert(strstr(md, "| **Overall** | **120.0** |") != NULL); +} + +int main(void) { + test_steady_60fps(); + test_spikes_and_hitches(); + test_markdown_and_routes(); + printf("PASS: bench_compute_stats, hitches, 1%%/0.1%% lows, sparkline, markdown, routes\n"); + return 0; +} From 6c0590787df04c18687e152a8a364167b957d6a6 Mon Sep 17 00:00:00 2001 From: jfpaardoo Date: Fri, 27 Nov 2026 10:00:35 +0100 Subject: [PATCH 2/6] benchmark: fix test-control link, gate menu start, and block save writes --- runtime/services/fs.c | 26 +++++++++++++++++++++++++- runtime/ui/benchmark_ui.mm | 15 +++++++++++---- runtime/ui/i18n/de.inc | 2 ++ runtime/ui/i18n/es.inc | 2 ++ runtime/ui/i18n/fr.inc | 2 ++ runtime/ui/i18n/he.inc | 2 ++ runtime/ui/i18n/it.inc | 2 ++ runtime/ui/i18n/ja.inc | 2 ++ runtime/ui/i18n/ko.inc | 2 ++ runtime/ui/i18n/nl.inc | 2 ++ runtime/ui/i18n/pt.inc | 2 ++ runtime/ui/i18n/ru.inc | 2 ++ runtime/ui/i18n/th.inc | 2 ++ runtime/ui/i18n/zh-Hans.inc | 2 ++ runtime/ui/i18n/zh-Hant.inc | 2 ++ tools/test_control.c | 3 +++ 16 files changed, 65 insertions(+), 5 deletions(-) diff --git a/runtime/services/fs.c b/runtime/services/fs.c index c36769601..98aa239ea 100644 --- a/runtime/services/fs.c +++ b/runtime/services/fs.c @@ -17,6 +17,7 @@ #include #include "../achievements.h" +#include "../benchmark.h" #include "../game_sites.h" #include "../hle.h" #include "../ipc.h" @@ -2274,6 +2275,11 @@ static bool flush_later(const char *path) { return queued; } +static bool is_save_path(const char *p) { + size_t n = g_save_dir ? strlen(g_save_dir) : 0; + return n && !strncmp(p, g_save_dir, n) && (p[n] == '/' || p[n] == '\\' || !p[n]); +} + // The game closed the file's session: its host descriptor (a Windows handle each) and the copy of the save go. static void file_close(Service *s) { HostFile *f = s->state; @@ -2308,6 +2314,8 @@ static void file(Service *s, IpcReq *req, IpcResp *resp) { if (f->patched) { // (test warp) n = off >= 0 && (uint64_t)off < f->patched_size ? (ssize_t)((uint64_t)size < f->patched_size - (uint64_t)off ? (uint64_t)size : f->patched_size - (uint64_t)off) : 0; memcpy((void *)(uintptr_t)b->addr, f->patched + off, (size_t)n); + } else if (f->fd < 0) { + n = 0; } else { uint64_t ft0 = plat_now_ns(); n = pread(f->fd, (void *)(uintptr_t)b->addr, (size_t)size, off); @@ -2322,6 +2330,7 @@ static void file(Service *s, IpcReq *req, IpcResp *resp) { break; } case 1: { // Write(option, offset, size) <- A + if (f->fd < 0 || (bench_active() && is_save_path(f->path))) break; int64_t off = IN(int64_t, 8), size = IN(int64_t, 16); IpcBuf *a = in_buf(req, 0); if (strstr(f->path, "savedata")) @@ -2336,10 +2345,12 @@ static void file(Service *s, IpcReq *req, IpcResp *resp) { break; } case 2: // Flush - if (f->written && !flush_later(f->path)) fsync(f->fd); // (its result unread, as before) + if (f->fd >= 0 && f->written && !(bench_active() && is_save_path(f->path)) && !flush_later(f->path)) + fsync(f->fd); // (its result unread, as before) f->written = false; break; case 3: { + if (f->fd < 0 || (bench_active() && is_save_path(f->path))) break; int tries = 0, r; while ((r = ftruncate(f->fd, IN(int64_t, 0))) && fs_retry(&tries, "resize", f->path)) {} if (r) resp->result = errno_result(); @@ -2348,6 +2359,7 @@ static void file(Service *s, IpcReq *req, IpcResp *resp) { } case 4: { struct stat sb; + if (f->fd < 0) { OUT(int64_t, 0) = 0; resp_size(resp, 8); break; } fstat(f->fd, &sb); OUT(int64_t, 0) = sb.st_size; resp_size(resp, 8); @@ -2433,6 +2445,18 @@ static void filesystem(Service *s, IpcReq *req, IpcResp *resp) { LOG("[fs] save: %s %s%s%s\n", req->cmd == 13 ? "clean dir" : what[req->cmd], p, req->cmd == 5 || req->cmd == 6 ? " -> " : "", req->cmd == 5 || req->cmd == 6 ? p2 : ""); } + if (bench_active() && is_save_path(p) && + (req->cmd <= 6 || req->cmd == 13 || (req->cmd == 8 && (IN(uint32_t, 0) & 2)))) { + if (req->cmd == 8) { + HostFile *f = calloc(1, sizeof *f); + f->fd = -1; + strlcpy(f->path, p, sizeof f->path); + Service *fsvc = service_new("IFile", file, f); + fsvc->on_close = file_close; + ipc_return_object(resp, fsvc); + } + return; + } int tries = 0, r; switch (req->cmd) { case 0: { // CreateFile(option, size) diff --git a/runtime/ui/benchmark_ui.mm b/runtime/ui/benchmark_ui.mm index 5bb97763f..8bd454232 100644 --- a/runtime/ui/benchmark_ui.mm +++ b/runtime/ui/benchmark_ui.mm @@ -13,6 +13,7 @@ #include #include "../benchmark.h" #include "../control.h" +#include "../framepace.h" } namespace { @@ -89,7 +90,9 @@ void bench_ui_tab(bool *want_close) { opt_begin("##benchmark", scale); float pos[3]; - bool in_world = control_tp_link_pos(pos); + bool in_world = control_tp_link_pos(pos) && !framepace_title_ui() && !framepace_loading_ui(); + bool in_pause = in_world && framepace_menu_ui(); + bool can_start = in_world && !in_pause; if (!in_world && !snap.has_results) { ImGui::TextDisabled("%s", tr("Load a save and enter the world to run the benchmark.")); opt_end(); @@ -127,10 +130,14 @@ void bench_ui_tab(bool *want_close) { tr("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.")); bool active = snap.phase >= BENCH_TELEPORTING && snap.phase <= BENCH_RESTORING; - if (!in_world) opt_disable_next(); - if (opt_action(tr("Start benchmark"), active ? tr("Running...") : (in_world ? tr("Start") : tr("In world only")), + if (in_pause && !active) { + ImGui::TextColored(ImVec4(0.95f, 0.72f, 0.30f, 1.0f), "%s", tr("Close the pause menu to run the benchmark.")); + } + if (!can_start) opt_disable_next(); + if (opt_action(tr("Start benchmark"), + active ? tr("Running...") : (can_start ? tr("Start") : (in_pause ? tr("In play only") : tr("In world only"))), tr("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results."), true)) { - if (!active && in_world) { + if (!active && can_start) { BenchConfig cfg = {mode, single_route, dur_vals[dur_idx], settle_vals[settle_idx], uncap}; if (bench_start(&cfg)) { notice[0] = 0; diff --git a/runtime/ui/i18n/de.inc b/runtime/ui/i18n/de.inc index aa4b4e49a..9ea6055d8 100644 --- a/runtime/ui/i18n/de.inc +++ b/runtime/ui/i18n/de.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "Aufwärmen...") T("Measuring...", "Messung läuft...") T("Restoring position...", "Stelle Position wieder her...") T("Press Esc to cancel", "Esc zum Abbrechen drücken") +T("Close the pause menu to run the benchmark.", "Schließe das Pausenmenü, um den Benchmark zu starten.") +T("In play only", "Nur im Spiel") diff --git a/runtime/ui/i18n/es.inc b/runtime/ui/i18n/es.inc index 5d510509f..61bce633d 100644 --- a/runtime/ui/i18n/es.inc +++ b/runtime/ui/i18n/es.inc @@ -1614,3 +1614,5 @@ T("Warming up...", "Estabilizando...") T("Measuring...", "Midiendo...") T("Restoring position...", "Restaurando posición...") T("Press Esc to cancel", "Pulsa Esc para cancelar") +T("Close the pause menu to run the benchmark.", "Cierra el menú de pausa para iniciar el benchmark.") +T("In play only", "Solo en juego") diff --git a/runtime/ui/i18n/fr.inc b/runtime/ui/i18n/fr.inc index 3c7267601..3555bd310 100644 --- a/runtime/ui/i18n/fr.inc +++ b/runtime/ui/i18n/fr.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "Préchauffage...") T("Measuring...", "Mesure en cours...") T("Restoring position...", "Restauration...") T("Press Esc to cancel", "Appuyez sur Échap pour annuler") +T("Close the pause menu to run the benchmark.", "Fermez le menu pause pour lancer le benchmark.") +T("In play only", "En jeu uniquement") diff --git a/runtime/ui/i18n/he.inc b/runtime/ui/i18n/he.inc index f58b024a6..ec8e5d005 100644 --- a/runtime/ui/i18n/he.inc +++ b/runtime/ui/i18n/he.inc @@ -1614,3 +1614,5 @@ T("Warming up...", "מתחמם...") T("Measuring...", "מודד...") T("Restoring position...", "משחזר מיקום...") T("Press Esc to cancel", "לחץ Esc לביטול") +T("Close the pause menu to run the benchmark.", "סגור את תפריט ההשהיה כדי להפעיל את הבנצ׳מרק.") +T("In play only", "במשחק בלבד") diff --git a/runtime/ui/i18n/it.inc b/runtime/ui/i18n/it.inc index ad10acb88..3df15e8bf 100644 --- a/runtime/ui/i18n/it.inc +++ b/runtime/ui/i18n/it.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "Riscaldamento...") T("Measuring...", "Misurazione...") T("Restoring position...", "Ripristino posizione...") T("Press Esc to cancel", "Premi Esc per annullare") +T("Close the pause menu to run the benchmark.", "Chiudi il menu di pausa per avviare il benchmark.") +T("In play only", "Solo in gioco") diff --git a/runtime/ui/i18n/ja.inc b/runtime/ui/i18n/ja.inc index 24feb1858..e995ffa9c 100644 --- a/runtime/ui/i18n/ja.inc +++ b/runtime/ui/i18n/ja.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "ウォームアップ中...") T("Measuring...", "計測中...") T("Restoring position...", "元の位置に戻しています...") T("Press Esc to cancel", "Escキーで中止") +T("Close the pause menu to run the benchmark.", "ベンチマークを実行するにはポーズメニューを閉じてください。") +T("In play only", "プレイ中のみ") diff --git a/runtime/ui/i18n/ko.inc b/runtime/ui/i18n/ko.inc index c3643e9df..4627c2ce3 100644 --- a/runtime/ui/i18n/ko.inc +++ b/runtime/ui/i18n/ko.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "예열 중...") T("Measuring...", "측정 중...") T("Restoring position...", "원래 위치로 복귀 중...") T("Press Esc to cancel", "Esc 키를 눌러 취소") +T("Close the pause menu to run the benchmark.", "벤치마크를 실행하려면 일시정지 메뉴를 닫으세요.") +T("In play only", "플레이 중에만") diff --git a/runtime/ui/i18n/nl.inc b/runtime/ui/i18n/nl.inc index 3626d2ecd..c104f7080 100644 --- a/runtime/ui/i18n/nl.inc +++ b/runtime/ui/i18n/nl.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "Opwarmen...") T("Measuring...", "Meten...") T("Restoring position...", "Positie herstellen...") T("Press Esc to cancel", "Druk op Esc om te annuleren") +T("Close the pause menu to run the benchmark.", "Sluit het pauzemenu om de benchmark te starten.") +T("In play only", "Alleen tijdens spelen") diff --git a/runtime/ui/i18n/pt.inc b/runtime/ui/i18n/pt.inc index a69cf82be..12308f518 100644 --- a/runtime/ui/i18n/pt.inc +++ b/runtime/ui/i18n/pt.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "Aquecendo...") T("Measuring...", "Medindo...") T("Restoring position...", "Restaurando posição...") T("Press Esc to cancel", "Pressione Esc para cancelar") +T("Close the pause menu to run the benchmark.", "Feche o menu de pausa para executar o benchmark.") +T("In play only", "Apenas em jogo") diff --git a/runtime/ui/i18n/ru.inc b/runtime/ui/i18n/ru.inc index b4c244144..0f89b728d 100644 --- a/runtime/ui/i18n/ru.inc +++ b/runtime/ui/i18n/ru.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "Прогрев...") T("Measuring...", "Замер...") T("Restoring position...", "Возврат на позицию...") T("Press Esc to cancel", "Нажмите Esc для отмены") +T("Close the pause menu to run the benchmark.", "Закройте меню паузы, чтобы запустить бенчмарк.") +T("In play only", "Только в игре") diff --git a/runtime/ui/i18n/th.inc b/runtime/ui/i18n/th.inc index 50d9053b1..fc48efc6a 100644 --- a/runtime/ui/i18n/th.inc +++ b/runtime/ui/i18n/th.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "กำลังอุ่นเครื่อง...") T("Measuring...", "กำลังวัดผล...") T("Restoring position...", "กำลังคืนตำแหน่ง...") T("Press Esc to cancel", "กด Esc เพื่อยกเลิก") +T("Close the pause menu to run the benchmark.", "ปิดเมนูหยุดชั่วคราวก่อนเริ่มการทดสอบประสิทธิภาพ") +T("In play only", "เฉพาะขณะเล่น") diff --git a/runtime/ui/i18n/zh-Hans.inc b/runtime/ui/i18n/zh-Hans.inc index 956509ccb..29bab0a23 100644 --- a/runtime/ui/i18n/zh-Hans.inc +++ b/runtime/ui/i18n/zh-Hans.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "预热中...") T("Measuring...", "测量中...") T("Restoring position...", "恢复位置中...") T("Press Esc to cancel", "按 Esc 取消") +T("Close the pause menu to run the benchmark.", "请先关闭暂停菜单再运行基准测试。") +T("In play only", "仅游玩时") diff --git a/runtime/ui/i18n/zh-Hant.inc b/runtime/ui/i18n/zh-Hant.inc index baf1b5b33..40e9aa2ac 100644 --- a/runtime/ui/i18n/zh-Hant.inc +++ b/runtime/ui/i18n/zh-Hant.inc @@ -1615,3 +1615,5 @@ T("Warming up...", "預熱中...") T("Measuring...", "測量中...") T("Restoring position...", "恢復位置中...") T("Press Esc to cancel", "按 Esc 取消") +T("Close the pause menu to run the benchmark.", "請先關閉暫停選單再執行基準測試。") +T("In play only", "僅遊玩時") diff --git a/tools/test_control.c b/tools/test_control.c index eb349a57b..0ff39e514 100644 --- a/tools/test_control.c +++ b/tools/test_control.c @@ -15,6 +15,9 @@ uint64_t plat_now_ns(void) { return 1; } void rt_fatal_trace(void) { abort(); } void control_game_frame(uint64_t frame) { (void)frame; } void control_place_frame(void) {} +void bench_frame(void) {} +bool bench_active(void) { return false; } +void control_tp_frame(void) {} static int failures, checks; #define CHECK(cond) do { checks++; if (!(cond)) { failures++; printf("FAIL line %d: %s\n", __LINE__, #cond); } } while (0) From 93146df5e518727844b2709d8a6a935d36a0347d Mon Sep 17 00:00:00 2001 From: jfpaardoo Date: Fri, 27 Nov 2026 10:03:39 +0100 Subject: [PATCH 3/6] benchmark: add frame-time histogram, GPU telemetry summary, and camera sweep --- runtime/benchmark.c | 29 +++++++++++++++++++++++++---- runtime/benchmark.h | 2 ++ tests/test_benchmark.c | 2 ++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/runtime/benchmark.c b/runtime/benchmark.c index 8f42a63f2..711e075f0 100644 --- a/runtime/benchmark.c +++ b/runtime/benchmark.c @@ -108,6 +108,10 @@ void bench_compute_stats(const uint32_t *frame_us, uint32_t count, double durati for (uint32_t i = 0; i < count; i++) { double ms = (double)frame_us[i] / 1000.0; if (ms > thresh) hitches++; + if (ms < 8.333) out->hist[0]++; + else if (ms < 16.667) out->hist[1]++; + else if (ms <= 33.333) out->hist[2]++; + else out->hist[3]++; } out->hitches = hitches; free(s); @@ -145,7 +149,8 @@ size_t bench_format_markdown(const BenchSnapshot *snap, char *buf, size_t n) { if (snap->gpu_name[0]) o = appendf(buf, n, o, "- **GPU**: %s\n", snap->gpu_name); if (snap->cpu_name[0]) o = appendf(buf, n, o, "- **CPU**: %s\n", snap->cpu_name); if (snap->width > 0 && snap->height > 0) o = appendf(buf, n, o, "- **Resolution**: %d x %d\n", snap->width, snap->height); - if (snap->settings_summary[0]) o = appendf(buf, n, o, "- **Settings**: %s\n", snap->settings_summary); + if (snap->settings_summary[0]) o = appendf(buf, n, o, "- **Settings**: %s%s\n", snap->settings_summary, + snap->cfg.camera_pan ? " | Camera sweep: On" : ""); o = appendf(buf, n, o, "\n| Route | Avg FPS | 1%% Low | 0.1%% Low | Avg ms | p99 ms | Max ms | Hitches | VRAM MB |\n"); o = appendf(buf, n, o, "|---|---:|---:|---:|---:|---:|---:|---:|---:|\n"); for (int i = 0; i < snap->nresults && i < BENCH_MAX_RESULTS; i++) { @@ -165,6 +170,16 @@ size_t bench_format_markdown(const BenchSnapshot *snap, char *buf, size_t n) { if (r->vram_peak_mb > 0) snprintf(vram, sizeof vram, "%.0f", r->vram_peak_mb); o = appendf(buf, n, o, "| **Overall** | **%.1f** | **%.1f** | **%.1f** | **%.2f** | **%.2f** | **%.1f** | **%u** | **%s** |\n", r->avg_fps, r->low_1pct_fps, r->low_01pct_fps, r->avg_ms, r->p99_ms, r->max_ms, r->hitches, vram); + if (r->frames > 0) { + double inv = 100.0 / (double)r->frames; + o = appendf(buf, n, o, + "\n- **Frame-time distribution**: `<8.3ms`: %.1f%% | `8.3-16.7ms`: %.1f%% | `16.7-33.3ms`: %.1f%% | `>33.3ms`: %.1f%%\n", + r->hist[0] * inv, r->hist[1] * inv, r->hist[2] * inv, r->hist[3] * inv); + } + if (r->gpu_load_avg > 0.0f || r->gpu_temp_peak > 0.0f || r->gpu_clock_avg > 0.0f) { + o = appendf(buf, n, o, "- **GPU telemetry**: load %.0f%% | peak temp %.0f C | avg clock %.0f MHz\n", + r->gpu_load_avg, r->gpu_temp_peak, r->gpu_clock_avg); + } } return o; } @@ -234,15 +249,16 @@ bool bench_save_csv(const BenchSnapshot *snap, char *out_path, size_t out_path_n FILE *f = fopen(path, "w"); if (!f) return false; - fprintf(f, "route_id,route_name,valid,frames,duration_s,avg_fps,low_1pct_fps,low_01pct_fps,avg_ms,median_ms,p95_ms,p99_ms,min_ms,max_ms,hitches,vram_peak_mb,ram_peak_mb,gpu_load_avg,gpu_temp_peak,gpu_clock_avg,gpu,width,height,settings\n"); + fprintf(f, "route_id,route_name,valid,frames,duration_s,avg_fps,low_1pct_fps,low_01pct_fps,avg_ms,median_ms,p95_ms,p99_ms,min_ms,max_ms,hitches,hist_lt8ms,hist_8_17ms,hist_17_33ms,hist_gt33ms,vram_peak_mb,ram_peak_mb,gpu_load_avg,gpu_temp_peak,gpu_clock_avg,gpu,width,height,settings\n"); for (int i = 0; i < snap->nresults && i < BENCH_MAX_RESULTS; i++) { const BenchRouteStats *r = &snap->results[i]; csv_escape(f, r->id); fputc(',', f); csv_escape(f, r->name); fputc(',', f); - fprintf(f, "%d,%u,%.3f,%.2f,%.2f,%.2f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%u,%.1f,%.1f,%.1f,%.1f,%.1f,", + fprintf(f, "%d,%u,%.3f,%.2f,%.2f,%.2f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%u,%u,%u,%u,%u,%.1f,%.1f,%.1f,%.1f,%.1f,", r->valid ? 1 : 0, r->frames, r->duration_s, r->avg_fps, r->low_1pct_fps, r->low_01pct_fps, r->avg_ms, r->median_ms, r->p95_ms, r->p99_ms, r->min_ms, r->max_ms, r->hitches, + r->hist[0], r->hist[1], r->hist[2], r->hist[3], r->vram_peak_mb, r->ram_peak_mb, r->gpu_load_avg, r->gpu_temp_peak, r->gpu_clock_avg); csv_escape(f, snap->gpu_name); fputc(',', f); fprintf(f, "%d,%d,", snap->width, snap->height); @@ -250,10 +266,11 @@ bool bench_save_csv(const BenchSnapshot *snap, char *out_path, size_t out_path_n } if (snap->overall.valid) { const BenchRouteStats *r = &snap->overall; - fprintf(f, "overall,Overall,1,%u,%.3f,%.2f,%.2f,%.2f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%u,%.1f,%.1f,%.1f,%.1f,%.1f,", + fprintf(f, "overall,Overall,1,%u,%.3f,%.2f,%.2f,%.2f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%u,%u,%u,%u,%u,%.1f,%.1f,%.1f,%.1f,%.1f,", r->frames, r->duration_s, r->avg_fps, r->low_1pct_fps, r->low_01pct_fps, r->avg_ms, r->median_ms, r->p95_ms, r->p99_ms, r->min_ms, r->max_ms, r->hitches, + r->hist[0], r->hist[1], r->hist[2], r->hist[3], r->vram_peak_mb, r->ram_peak_mb, r->gpu_load_avg, r->gpu_temp_peak, r->gpu_clock_avg); csv_escape(f, snap->gpu_name); fputc(',', f); fprintf(f, "%d,%d,", snap->width, snap->height); @@ -674,6 +691,10 @@ void bench_frame(uint64_t frame) { if (ps.gpu_pct >= 0.0f) { g_load_sum += ps.gpu_pct; g_load_n++; } if (ps.gpu_clock_mhz > 0.0f) { g_clk_sum += ps.gpu_clock_mhz; g_clk_n++; } } + if (g_snap.cfg.camera_pan && ridx >= 0 && !control_look_active()) { + double pan_yaw = k_routes[ridx].yaw + 30.0 * sin(elapsed * 0.5); + control_look_start(true, pan_yaw, true, k_routes[ridx].pitch, 1); + } if (elapsed >= (double)g_snap.cfg.duration_s || g_route_frames >= BENCH_MAX_FRAMES) { finish_measuring_route(now, elapsed); } diff --git a/runtime/benchmark.h b/runtime/benchmark.h index fb98835fc..4462f9d5e 100644 --- a/runtime/benchmark.h +++ b/runtime/benchmark.h @@ -39,6 +39,7 @@ typedef struct { int duration_s; // sample window per route (seconds) int settle_s; // warm-up settle window before sampling (seconds) bool uncap_fps; // uncap fps_limit, vsync, frame_gen and perf_overlay during the run + bool camera_pan; // gently sweep camera yaw during measurement on canonical routes } BenchConfig; typedef struct { @@ -68,6 +69,7 @@ typedef struct { double min_ms; double max_ms; uint32_t hitches; + uint32_t hist[4]; // frame-time bins: <8.33ms (>=120fps), 8.33-16.67ms, 16.67-33.33ms, >33.33ms (<30fps) float spark_ms[BENCH_SPARK_LEN]; int spark_n; float vram_peak_mb; diff --git a/tests/test_benchmark.c b/tests/test_benchmark.c index 801f8227b..1bc2cb70e 100644 --- a/tests/test_benchmark.c +++ b/tests/test_benchmark.c @@ -24,6 +24,7 @@ static void test_steady_60fps(void) { assert(near_d(st.median_ms, 16.667, 0.01)); assert(near_d(st.p99_ms, 16.667, 0.01)); assert(st.hitches == 0); + assert(st.hist[0] == 0 && st.hist[1] == 0 && st.hist[2] == 600 && st.hist[3] == 0); assert(st.spark_n == BENCH_SPARK_LEN); } @@ -51,6 +52,7 @@ static void test_spikes_and_hitches(void) { assert(near_d(st.low_01pct_fps, 10.0, 0.1)); // Hitches: threshold is max(2 * 10 = 20, 33.333) = 33.333 ms => 10 + 2 = 12 hitches assert(st.hitches == 12); + assert(st.hist[0] == 0 && st.hist[1] == 988 && st.hist[2] == 0 && st.hist[3] == 12); // Metadata preserved assert(near_d(st.vram_peak_mb, 2450.0, 0.01)); // Max downsampling must preserve the 100 ms spikes in the sparkline From 8e9894ee134886c5cadda3d800d276a43cad210d Mon Sep 17 00:00:00 2001 From: jfpaardoo Date: Fri, 27 Nov 2026 10:04:43 +0100 Subject: [PATCH 4/6] ui: add benchmark A/B baseline comparison, histogram bar, and camera sweep toggle --- runtime/ui/benchmark_ui.mm | 106 +++++++++++++++++++++++++++++++++---- 1 file changed, 96 insertions(+), 10 deletions(-) diff --git a/runtime/ui/benchmark_ui.mm b/runtime/ui/benchmark_ui.mm index 8bd454232..141b1143c 100644 --- a/runtime/ui/benchmark_ui.mm +++ b/runtime/ui/benchmark_ui.mm @@ -27,7 +27,7 @@ void kpi_card(const char *id, const char *label, const char *value, ImVec4 val_c ImGui::EndChild(); } -void draw_frametime_graph(const BenchRouteStats *r, float scale) { +void draw_frametime_graph(const BenchRouteStats *r, const BenchRouteStats *base, float scale) { if (!r || !r->valid || r->spark_n <= 0) return; float w = ImGui::GetContentRegionAvail().x; if (w < 120 * scale) w = 120 * scale; @@ -42,6 +42,7 @@ void draw_frametime_graph(const BenchRouteStats *r, float scale) { dl->AddRect(p0, p1, IM_COL32(70, 90, 82, 180), 6.0f * scale); float max_ms = (float)r->max_ms; + if (base && base->valid && (float)base->max_ms > max_ms) max_ms = (float)base->max_ms; if (max_ms < 40.0f) max_ms = 40.0f; if (max_ms > 100.0f) max_ms = 100.0f; @@ -58,6 +59,19 @@ void draw_frametime_graph(const BenchRouteStats *r, float scale) { dl->AddText(ImVec2(p0.x + 6 * scale, y - ImGui::GetFontSize() * 0.95f), rf.col, rf.lbl); } + if (base && base->valid && base->spark_n > 1) { + int bn = base->spark_n; + float bdx = (w - 8 * scale) / (float)(bn - 1); + for (int i = 1; i < bn; i++) { + float v0 = base->spark_ms[i - 1], v1 = base->spark_ms[i]; + if (v0 > max_ms) v0 = max_ms; + if (v1 > max_ms) v1 = max_ms; + ImVec2 a(p0.x + 4 * scale + (float)(i - 1) * bdx, p1.y - (v0 / max_ms) * (h - 8 * scale) - 4 * scale); + ImVec2 b(p0.x + 4 * scale + (float)i * bdx, p1.y - (v1 / max_ms) * (h - 8 * scale) - 4 * scale); + dl->AddLine(a, b, IM_COL32(110, 185, 245, 145), 1.4f * scale); + } + } + int n = r->spark_n; float dx = n > 1 ? (w - 8 * scale) / (float)(n - 1) : 0.0f; for (int i = 1; i < n; i++) { @@ -71,6 +85,44 @@ void draw_frametime_graph(const BenchRouteStats *r, float scale) { } } +void draw_hist_bar(const BenchRouteStats *r, float scale) { + if (!r || !r->valid || r->frames == 0) return; + float w = ImGui::GetContentRegionAvail().x; + if (w < 120 * scale) w = 120 * scale; + float h = 12 * scale; + ImVec2 p0 = ImGui::GetCursorScreenPos(); + ImGui::Dummy(ImVec2(w, h)); + ImDrawList *dl = ImGui::GetWindowDrawList(); + static const ImU32 cols[4] = { + IM_COL32(115, 205, 105, 230), + IM_COL32(175, 215, 90, 230), + IM_COL32(235, 195, 75, 230), + IM_COL32(235, 95, 85, 230), + }; + float x = p0.x; + float inv = 1.0f / (float)r->frames; + for (int i = 0; i < 4; i++) { + float sw = w * ((float)r->hist[i] * inv); + if (sw >= 1.0f) { + dl->AddRectFilled(ImVec2(x, p0.y), ImVec2(x + sw, p0.y + h), cols[i]); + x += sw; + } + } + dl->AddRect(p0, ImVec2(p0.x + w, p0.y + h), IM_COL32(70, 90, 82, 180)); + double p_inv = 100.0 / (double)r->frames; + ImGui::TextDisabled("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", + r->hist[0] * p_inv, r->hist[1] * p_inv, r->hist[2] * p_inv, r->hist[3] * p_inv); +} + +const BenchRouteStats *find_baseline_route(const BenchSnapshot &base, bool has_base, const BenchRouteStats *cur, bool is_overall) { + if (!has_base || !base.has_results || !cur || !cur->valid) return NULL; + if (is_overall) return base.overall.valid ? &base.overall : (base.nresults == 1 && base.results[0].valid ? &base.results[0] : NULL); + for (int i = 0; i < base.nresults && i < BENCH_MAX_RESULTS; i++) { + if (base.results[i].valid && cur->id[0] && !strcmp(base.results[i].id, cur->id)) return &base.results[i]; + } + return NULL; +} + } // namespace void bench_ui_tab(bool *want_close) { @@ -79,6 +131,9 @@ void bench_ui_tab(bool *want_close) { static int dur_idx = 1; // 10 s static int settle_idx = 1; // 5 s static bool uncap = true; + static bool camera_pan = false; + static bool has_baseline = false; + static BenchSnapshot baseline; static int selected_row = -1; // -1 = overall static char notice[280]; @@ -129,6 +184,11 @@ void bench_ui_tab(bool *want_close) { opt_toggle(tr("Uncap FPS and VSync"), &uncap, true, tr("Temporarily turns off Frame rate limit, VSync and Frame generation during measurement, then restores your settings afterwards.")); + if (mode != BENCH_MODE_SPOT) { + opt_toggle(tr("Camera sweep"), &camera_pan, false, + tr("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.")); + } + bool active = snap.phase >= BENCH_TELEPORTING && snap.phase <= BENCH_RESTORING; if (in_pause && !active) { ImGui::TextColored(ImVec4(0.95f, 0.72f, 0.30f, 1.0f), "%s", tr("Close the pause menu to run the benchmark.")); @@ -138,7 +198,7 @@ void bench_ui_tab(bool *want_close) { active ? tr("Running...") : (can_start ? tr("Start") : (in_pause ? tr("In play only") : tr("In world only"))), tr("Runs the selected benchmark suite and returns Link cleanly to his starting position with full results."), true)) { if (!active && can_start) { - BenchConfig cfg = {mode, single_route, dur_vals[dur_idx], settle_vals[settle_idx], uncap}; + BenchConfig cfg = {mode, single_route, dur_vals[dur_idx], settle_vals[settle_idx], uncap, camera_pan}; if (bench_start(&cfg)) { notice[0] = 0; selected_row = -1; @@ -157,16 +217,24 @@ void bench_ui_tab(bool *want_close) { ImGui::TextColored(ImVec4(0.95f, 0.72f, 0.30f, 1.0f), "%s", tr("Partial results (cancelled early):")); const BenchRouteStats *kpi = snap.overall.valid ? &snap.overall : &snap.results[0]; + const BenchRouteStats *kpi_base = find_baseline_route(baseline, has_baseline, kpi, snap.overall.valid); if (kpi && kpi->valid) { float avail = ImGui::GetContentRegionAvail().x; float gap = ImGui::GetStyle().ItemSpacing.x; float cw = (avail - gap * 4.0f) / 5.0f; if (cw < 80 * scale) cw = 80 * scale; - char v_avg[24], v_1p[24], v_01p[24], v_hit[24], v_vram[24]; - snprintf(v_avg, sizeof v_avg, "%.1f", kpi->avg_fps); - snprintf(v_1p, sizeof v_1p, "%.1f", kpi->low_1pct_fps); - snprintf(v_01p, sizeof v_01p, "%.1f", kpi->low_01pct_fps); - snprintf(v_hit, sizeof v_hit, "%u", kpi->hitches); + char v_avg[36], v_1p[36], v_01p[36], v_hit[36], v_vram[36]; + if (kpi_base) { + snprintf(v_avg, sizeof v_avg, "%.1f (%+.1f)", kpi->avg_fps, kpi->avg_fps - kpi_base->avg_fps); + snprintf(v_1p, sizeof v_1p, "%.1f (%+.1f)", kpi->low_1pct_fps, kpi->low_1pct_fps - kpi_base->low_1pct_fps); + snprintf(v_01p, sizeof v_01p, "%.1f (%+.1f)", kpi->low_01pct_fps, kpi->low_01pct_fps - kpi_base->low_01pct_fps); + snprintf(v_hit, sizeof v_hit, "%u (%+d)", kpi->hitches, (int)kpi->hitches - (int)kpi_base->hitches); + } else { + snprintf(v_avg, sizeof v_avg, "%.1f", kpi->avg_fps); + snprintf(v_1p, sizeof v_1p, "%.1f", kpi->low_1pct_fps); + snprintf(v_01p, sizeof v_01p, "%.1f", kpi->low_01pct_fps); + snprintf(v_hit, sizeof v_hit, "%u", kpi->hitches); + } if (kpi->vram_peak_mb > 0) snprintf(v_vram, sizeof v_vram, "%.0f MB", kpi->vram_peak_mb); else snprintf(v_vram, sizeof v_vram, "-"); @@ -238,11 +306,29 @@ void bench_ui_tab(bool *want_close) { const BenchRouteStats *graph_r = (selected_row >= 0 && selected_row < snap.nresults) ? &snap.results[selected_row] : (snap.overall.valid ? &snap.overall : &snap.results[0]); + bool graph_is_overall = !(selected_row >= 0 && selected_row < snap.nresults) && snap.overall.valid; + const BenchRouteStats *graph_base = find_baseline_route(baseline, has_baseline, graph_r, graph_is_overall); if (graph_r && graph_r->valid) { - ImGui::TextDisabled("%s: %s (%.1f - %.1f ms, %s %.2f ms)", + ImGui::TextDisabled("%s: %s (%.1f - %.1f ms, %s %.2f ms%s)", tr("Frame time"), graph_r->name[0] ? graph_r->name : tr("Overall"), - graph_r->min_ms, graph_r->max_ms, tr("median"), graph_r->median_ms); - draw_frametime_graph(graph_r, scale); + graph_r->min_ms, graph_r->max_ms, tr("median"), graph_r->median_ms, + graph_base ? " | blue = baseline" : ""); + draw_frametime_graph(graph_r, graph_base, scale); + draw_hist_bar(graph_r, scale); + } + + if (opt_action(tr("Baseline comparison"), has_baseline ? tr("Update baseline") : tr("Set baseline"), + tr("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs."), true)) { + baseline = snap; + has_baseline = true; + snprintf(notice, sizeof notice, "%s", tr("Saved current results as baseline.")); + } + if (has_baseline) { + if (opt_action(tr("Clear baseline"), tr("Clear"), + tr("Removes the stored A/B baseline comparison."), true)) { + has_baseline = false; + notice[0] = 0; + } } if (opt_action(tr("Copy Markdown report"), tr("Copy"), From b8c87e3faa8266a88642440babab3930b7becd9f Mon Sep 17 00:00:00 2001 From: jfpaardoo Date: Fri, 27 Nov 2026 10:06:08 +0100 Subject: [PATCH 5/6] benchmark: add bench console command and guard bench_start in menus --- runtime/benchmark.c | 69 ++++++++++++++++++++++++++++++++++++++++++ runtime/benchmark.h | 1 + runtime/control_game.c | 2 ++ 3 files changed, 72 insertions(+) diff --git a/runtime/benchmark.c b/runtime/benchmark.c index 711e075f0..410d54911 100644 --- a/runtime/benchmark.c +++ b/runtime/benchmark.c @@ -187,6 +187,7 @@ size_t bench_format_markdown(const BenchSnapshot *snap, char *buf, size_t n) { #ifndef BENCH_STATS_ONLY #include #include "control.h" +#include "framepace.h" #include "hle.h" #include "nvn/output_scale.h" #include "paths.h" @@ -524,6 +525,7 @@ static void finish_measuring_route(uint64_t now_ns, double elapsed_s) { bool bench_start(const BenchConfig *cfg) { if (!cfg) return false; + if (framepace_title_ui() || framepace_loading_ui() || framepace_menu_ui()) return false; float pos[3]; if (!control_tp_link_pos(pos)) return false; pthread_mutex_lock(&g_lock); @@ -746,4 +748,71 @@ RT_ON_RESET(bench_reset) { pthread_mutex_unlock(&g_lock); } +static void cmd_bench(int argc, char **argv, ControlReply *r) { + if (argc < 2 || !strcmp(argv[1], "status")) { + BenchSnapshot snap; + bench_snapshot(&snap); + static const char *const phase_names[] = { + "idle", "teleporting", "aiming", "settling", "measuring", "restoring", "done", "cancelled" + }; + const char *pn = (snap.phase >= 0 && snap.phase <= BENCH_CANCELLED) ? phase_names[snap.phase] : "unknown"; + control_field_str(r, "phase", pn); + control_field_bool(r, "has_results", snap.has_results); + if (snap.phase >= BENCH_TELEPORTING && snap.phase <= BENCH_RESTORING) { + control_field_str(r, "route", snap.current_route_name); + control_field_num(r, "live_fps", snap.live_fps); + control_text(r, "Benchmark %s: %s (%d/%d, %.1f fps)", pn, snap.current_route_name, + snap.route_idx + 1, snap.route_total, snap.live_fps); + } else if (snap.has_results && snap.overall.valid) { + control_field_num(r, "avg_fps", snap.overall.avg_fps); + control_field_num(r, "low_1pct_fps", snap.overall.low_1pct_fps); + control_field_int(r, "hitches", (int64_t)snap.overall.hitches); + control_text(r, "Benchmark %s: %.1f avg fps, %.1f 1%% low, %u hitches (%d routes)", + pn, snap.overall.avg_fps, snap.overall.low_1pct_fps, snap.overall.hitches, snap.nresults); + } else { + control_text(r, "Benchmark %s", pn); + } + return; + } + if (!strcmp(argv[1], "cancel")) { + bench_cancel(); + control_text(r, "Benchmark cancel requested"); + return; + } + BenchConfig cfg = {BENCH_MODE_FULL, 0, 10, 5, true, false}; + if (!strcmp(argv[1], "full")) cfg.mode = BENCH_MODE_FULL; + else if (!strcmp(argv[1], "quick")) cfg.mode = BENCH_MODE_QUICK; + else if (!strcmp(argv[1], "spot")) cfg.mode = BENCH_MODE_SPOT; + else if (!strcmp(argv[1], "route")) { + if (argc < 3) { + control_fail(r, "bench route: specify one of plateau, kakariko, field, rito, castle, hateno, korok"); + return; + } + int found = -1; + for (int i = 0; i < BENCH_ROUTE_COUNT; i++) + if (!strcmp(argv[2], k_routes[i].id)) { found = i; break; } + if (found < 0) { + control_fail(r, "bench route: unknown route '%s'", argv[2]); + return; + } + cfg.mode = BENCH_MODE_SINGLE; + cfg.single_route = found; + } else { + control_fail(r, "bench: use bench [status | full | quick | spot | route | cancel]"); + return; + } + if (!bench_start(&cfg)) { + control_fail(r, "bench: cannot start (must be in active gameplay, not in menus or already running)"); + return; + } + control_text(r, "Benchmark started (%s)", argv[1]); +} + +void bench_control_init(void) { + static const ControlCmd cmds[] = { + {"bench", "[status | full | quick | spot | route | cancel]", "Run or inspect the built-in performance benchmark", cmd_bench, CONTROL_PLAYER}, + }; + control_register(cmds, 1); +} + #endif diff --git a/runtime/benchmark.h b/runtime/benchmark.h index 4462f9d5e..ed75a01e7 100644 --- a/runtime/benchmark.h +++ b/runtime/benchmark.h @@ -110,6 +110,7 @@ bool bench_active(void); bool bench_hud_visible(void); void bench_snapshot(BenchSnapshot *out); void bench_frame(uint64_t frame); +void bench_control_init(void); void bench_compute_stats(const uint32_t *frame_us, uint32_t count, double duration_s, BenchRouteStats *out); size_t bench_format_markdown(const BenchSnapshot *snap, char *buf, size_t n); diff --git a/runtime/control_game.c b/runtime/control_game.c index 8a3653692..2464d4c93 100644 --- a/runtime/control_game.c +++ b/runtime/control_game.c @@ -7,6 +7,7 @@ #include #include "control.h" +#include "benchmark.h" #include "game_flags.h" #include "control_cells.h" #include "control_places.h" @@ -503,6 +504,7 @@ void control_game_init(void) { }; control_register(player, (int)(sizeof player / sizeof *player)); control_settings_init(); // (get for everyone, set only in developer mode) + bench_control_init(); if (!control_enabled()) return; static const ControlCmd dev[] = { {"time", "[freeze | unfreeze | set <0-24> | <0-24>]", "Show or change the hour of the day", cmd_time, 0}, From 2fd31f2825bc33a6bde56f66caa4397ee5e71b42 Mon Sep 17 00:00:00 2001 From: jfpaardoo Date: Fri, 27 Nov 2026 10:07:23 +0100 Subject: [PATCH 6/6] i18n: add translations for benchmark baseline comparison and camera sweep --- runtime/ui/benchmark_ui.mm | 15 ++++++++++----- runtime/ui/i18n/de.inc | 11 +++++++++++ runtime/ui/i18n/es.inc | 11 +++++++++++ runtime/ui/i18n/fr.inc | 11 +++++++++++ runtime/ui/i18n/he.inc | 11 +++++++++++ runtime/ui/i18n/it.inc | 11 +++++++++++ runtime/ui/i18n/ja.inc | 11 +++++++++++ runtime/ui/i18n/ko.inc | 11 +++++++++++ runtime/ui/i18n/nl.inc | 11 +++++++++++ runtime/ui/i18n/pt.inc | 11 +++++++++++ runtime/ui/i18n/ru.inc | 11 +++++++++++ runtime/ui/i18n/th.inc | 11 +++++++++++ runtime/ui/i18n/zh-Hans.inc | 11 +++++++++++ runtime/ui/i18n/zh-Hant.inc | 11 +++++++++++ 14 files changed, 153 insertions(+), 5 deletions(-) diff --git a/runtime/ui/benchmark_ui.mm b/runtime/ui/benchmark_ui.mm index 141b1143c..5e484cb8e 100644 --- a/runtime/ui/benchmark_ui.mm +++ b/runtime/ui/benchmark_ui.mm @@ -110,8 +110,10 @@ void draw_hist_bar(const BenchRouteStats *r, float scale) { } dl->AddRect(p0, ImVec2(p0.x + w, p0.y + h), IM_COL32(70, 90, 82, 180)); double p_inv = 100.0 / (double)r->frames; - ImGui::TextDisabled("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", - r->hist[0] * p_inv, r->hist[1] * p_inv, r->hist[2] * p_inv, r->hist[3] * p_inv); + char hbuf[160]; + snprintf(hbuf, sizeof hbuf, "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", + r->hist[0] * p_inv, r->hist[1] * p_inv, r->hist[2] * p_inv, r->hist[3] * p_inv); + ImGui::TextDisabled("%s", hbuf); } const BenchRouteStats *find_baseline_route(const BenchSnapshot &base, bool has_base, const BenchRouteStats *cur, bool is_overall) { @@ -309,10 +311,13 @@ void bench_ui_tab(bool *want_close) { bool graph_is_overall = !(selected_row >= 0 && selected_row < snap.nresults) && snap.overall.valid; const BenchRouteStats *graph_base = find_baseline_route(baseline, has_baseline, graph_r, graph_is_overall); if (graph_r && graph_r->valid) { - ImGui::TextDisabled("%s: %s (%.1f - %.1f ms, %s %.2f ms%s)", + ImGui::TextDisabled("%s: %s (%.1f - %.1f ms, %s %.2f ms)", tr("Frame time"), graph_r->name[0] ? graph_r->name : tr("Overall"), - graph_r->min_ms, graph_r->max_ms, tr("median"), graph_r->median_ms, - graph_base ? " | blue = baseline" : ""); + graph_r->min_ms, graph_r->max_ms, tr("median"), graph_r->median_ms); + if (graph_base) { + ImGui::SameLine(); + ImGui::TextColored(ImVec4(0.43f, 0.73f, 0.96f, 1.0f), "(%s)", tr("blue = baseline")); + } draw_frametime_graph(graph_r, graph_base, scale); draw_hist_bar(graph_r, scale); } diff --git a/runtime/ui/i18n/de.inc b/runtime/ui/i18n/de.inc index 9ea6055d8..6006d4c9d 100644 --- a/runtime/ui/i18n/de.inc +++ b/runtime/ui/i18n/de.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "Stelle Position wieder her...") T("Press Esc to cancel", "Esc zum Abbrechen drücken") T("Close the pause menu to run the benchmark.", "Schließe das Pausenmenü, um den Benchmark zu starten.") T("In play only", "Nur im Spiel") +T("Camera sweep", "Kameraschwenk") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "Schwenkt die Kamera während der Messung sanft, um Streaming und LODs statt einer festen Ansicht zu testen.") +T("Baseline comparison", "Referenzvergleich (A/B)") +T("Update baseline", "Referenz aktualisieren") +T("Set baseline", "Als Referenz setzen") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "Speichert die aktuellen Ergebnisse als Referenz, um bei künftigen Läufen FPS/ms-Deltas und eine Vergleichskurve anzuzeigen.") +T("Saved current results as baseline.", "Aktuelle Ergebnisse als Referenz gespeichert.") +T("Clear baseline", "Referenz löschen") +T("Removes the stored A/B baseline comparison.", "Entfernt den gespeicherten A/B-Referenzvergleich.") +T("blue = baseline", "Blau = Referenz") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/es.inc b/runtime/ui/i18n/es.inc index 61bce633d..5f6dfd019 100644 --- a/runtime/ui/i18n/es.inc +++ b/runtime/ui/i18n/es.inc @@ -1616,3 +1616,14 @@ T("Restoring position...", "Restaurando posición...") T("Press Esc to cancel", "Pulsa Esc para cancelar") T("Close the pause menu to run the benchmark.", "Cierra el menú de pausa para iniciar el benchmark.") T("In play only", "Solo en juego") +T("Camera sweep", "Barrido de cámara") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "Gira suavemente la cámara durante la medición para exigir streaming y LOD en lugar de mantener una vista fija.") +T("Baseline comparison", "Comparativa A/B") +T("Update baseline", "Actualizar referencia") +T("Set baseline", "Fijar referencia") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "Guarda los resultados actuales como referencia para mostrar diferencias de FPS/ms y una curva base en siguientes pasadas.") +T("Saved current results as baseline.", "Resultados actuales guardados como referencia.") +T("Clear baseline", "Borrar referencia") +T("Removes the stored A/B baseline comparison.", "Elimina la referencia guardada para la comparativa A/B.") +T("blue = baseline", "azul = referencia") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/fr.inc b/runtime/ui/i18n/fr.inc index 3555bd310..49013a0c0 100644 --- a/runtime/ui/i18n/fr.inc +++ b/runtime/ui/i18n/fr.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "Restauration...") T("Press Esc to cancel", "Appuyez sur Échap pour annuler") T("Close the pause menu to run the benchmark.", "Fermez le menu pause pour lancer le benchmark.") T("In play only", "En jeu uniquement") +T("Camera sweep", "Balayage de caméra") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "Fait pivoter doucement la caméra pendant la mesure pour solliciter le streaming et les LOD plutôt qu'une vue fixe.") +T("Baseline comparison", "Comparaison A/B") +T("Update baseline", "Mettre à jour la référence") +T("Set baseline", "Définir comme référence") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "Enregistre les résultats actuels comme référence pour afficher les écarts FPS/ms et une courbe de base.") +T("Saved current results as baseline.", "Résultats actuels enregistrés comme référence.") +T("Clear baseline", "Effacer la référence") +T("Removes the stored A/B baseline comparison.", "Supprime la référence enregistrée pour la comparaison A/B.") +T("blue = baseline", "bleu = référence") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/he.inc b/runtime/ui/i18n/he.inc index ec8e5d005..79e32baf0 100644 --- a/runtime/ui/i18n/he.inc +++ b/runtime/ui/i18n/he.inc @@ -1616,3 +1616,14 @@ T("Restoring position...", "משחזר מיקום...") T("Press Esc to cancel", "לחץ Esc לביטול") T("Close the pause menu to run the benchmark.", "סגור את תפריט ההשהיה כדי להפעיל את הבנצ׳מרק.") T("In play only", "במשחק בלבד") +T("Camera sweep", "סיבוב מצלמה") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "מזיז בעדינות את המצלמה בזמן המדידה כדי לבדוק טעינה ו-LOD במקום מבט קבוע.") +T("Baseline comparison", "השוואת בסיס (A/B)") +T("Update baseline", "עדכן בסיס") +T("Set baseline", "קבע כבסיס") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "שומר את התוצאות הנוכחיות כהשוואה להצגת הפרשי FPS/ms ועקומת בסיס בהרצות הבאות.") +T("Saved current results as baseline.", "התוצאות הנוכחיות נשמרו כבסיס.") +T("Clear baseline", "נקה בסיס") +T("Removes the stored A/B baseline comparison.", "מסיר את השוואת הבסיס השמורה.") +T("blue = baseline", "כחול = בסיס") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/it.inc b/runtime/ui/i18n/it.inc index 3df15e8bf..3f60af8a4 100644 --- a/runtime/ui/i18n/it.inc +++ b/runtime/ui/i18n/it.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "Ripristino posizione...") T("Press Esc to cancel", "Premi Esc per annullare") T("Close the pause menu to run the benchmark.", "Chiudi il menu di pausa per avviare il benchmark.") T("In play only", "Solo in gioco") +T("Camera sweep", "Panoramica telecamera") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "Ruota leggermente la telecamera durante la misurazione per sollecitare streaming e LOD invece di una vista fissa.") +T("Baseline comparison", "Confronto A/B") +T("Update baseline", "Aggiorna riferimento") +T("Set baseline", "Imposta riferimento") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "Salva i risultati attuali come riferimento per mostrare differenze FPS/ms e una curva di base nei test successivi.") +T("Saved current results as baseline.", "Risultati attuali salvati come riferimento.") +T("Clear baseline", "Cancella riferimento") +T("Removes the stored A/B baseline comparison.", "Rimuove il riferimento salvato per il confronto A/B.") +T("blue = baseline", "blu = riferimento") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/ja.inc b/runtime/ui/i18n/ja.inc index e995ffa9c..8524b304a 100644 --- a/runtime/ui/i18n/ja.inc +++ b/runtime/ui/i18n/ja.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "元の位置に戻しています...") T("Press Esc to cancel", "Escキーで中止") T("Close the pause menu to run the benchmark.", "ベンチマークを実行するにはポーズメニューを閉じてください。") T("In play only", "プレイ中のみ") +T("Camera sweep", "カメラパン") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "固定視点ではなく計測中にカメラをゆっくり動かし、ストリーミングやLODに負荷をかけます。") +T("Baseline comparison", "ベースライン比較 (A/B)") +T("Update baseline", "ベースラインを更新") +T("Set baseline", "ベースラインに設定") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "現在の結果を基準として保存し、次回以降の計測でFPS/msの差分と基準曲線を表示します。") +T("Saved current results as baseline.", "現在の結果をベースラインとして保存しました。") +T("Clear baseline", "ベースラインを消去") +T("Removes the stored A/B baseline comparison.", "保存されたA/B比較のベースラインを削除します。") +T("blue = baseline", "青 = ベースライン") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/ko.inc b/runtime/ui/i18n/ko.inc index 4627c2ce3..c242db3c3 100644 --- a/runtime/ui/i18n/ko.inc +++ b/runtime/ui/i18n/ko.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "원래 위치로 복귀 중...") T("Press Esc to cancel", "Esc 키를 눌러 취소") T("Close the pause menu to run the benchmark.", "벤치마크를 실행하려면 일시정지 메뉴를 닫으세요.") T("In play only", "플레이 중에만") +T("Camera sweep", "카메라 회전") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "고정 시점 대신 측정 중 카메라를 부드럽게 회전해 스트리밍과 LOD 부하를 시험합니다.") +T("Baseline comparison", "기준 비교 (A/B)") +T("Update baseline", "기준 업데이트") +T("Set baseline", "기준으로 설정") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "현재 결과를 기준으로 저장해 이후 실행에서 FPS/ms 차이 및 기준 그래프를 표시합니다.") +T("Saved current results as baseline.", "현재 결과를 기준으로 저장했습니다.") +T("Clear baseline", "기준 지우기") +T("Removes the stored A/B baseline comparison.", "저장된 A/B 기준 비교를 제거합니다.") +T("blue = baseline", "파랑 = 기준") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/nl.inc b/runtime/ui/i18n/nl.inc index c104f7080..b761cf62f 100644 --- a/runtime/ui/i18n/nl.inc +++ b/runtime/ui/i18n/nl.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "Positie herstellen...") T("Press Esc to cancel", "Druk op Esc om te annuleren") T("Close the pause menu to run the benchmark.", "Sluit het pauzemenu om de benchmark te starten.") T("In play only", "Alleen tijdens spelen") +T("Camera sweep", "Camerabeweging") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "Draait de camera zachtjes tijdens de meting om streaming en LODs te belasten in plaats van een vast beeld.") +T("Baseline comparison", "Referentievergelijking (A/B)") +T("Update baseline", "Referentie bijwerken") +T("Set baseline", "Als referentie instellen") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "Slaat de huidige resultaten op als referentie om FPS/ms-verschillen en een basislijn bij volgende runs te tonen.") +T("Saved current results as baseline.", "Huidige resultaten opgeslagen als referentie.") +T("Clear baseline", "Referentie wissen") +T("Removes the stored A/B baseline comparison.", "Verwijdert de opgeslagen A/B-referentievergelijking.") +T("blue = baseline", "blauw = referentie") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/pt.inc b/runtime/ui/i18n/pt.inc index 12308f518..1acfd54de 100644 --- a/runtime/ui/i18n/pt.inc +++ b/runtime/ui/i18n/pt.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "Restaurando posição...") T("Press Esc to cancel", "Pressione Esc para cancelar") T("Close the pause menu to run the benchmark.", "Feche o menu de pausa para executar o benchmark.") T("In play only", "Apenas em jogo") +T("Camera sweep", "Varredura de câmera") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "Move a câmera suavemente durante a medição para exigir streaming e LODs em vez de manter uma vista fixa.") +T("Baseline comparison", "Comparação A/B") +T("Update baseline", "Atualizar referência") +T("Set baseline", "Definir referência") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "Salva os resultados atuais como referência para mostrar deltas de FPS/ms e uma curva base nas próximas execuções.") +T("Saved current results as baseline.", "Resultados atuais salvos como referência.") +T("Clear baseline", "Limpar referência") +T("Removes the stored A/B baseline comparison.", "Remove a referência salva para comparação A/B.") +T("blue = baseline", "azul = referência") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/ru.inc b/runtime/ui/i18n/ru.inc index 0f89b728d..aa03c28aa 100644 --- a/runtime/ui/i18n/ru.inc +++ b/runtime/ui/i18n/ru.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "Возврат на позицию...") T("Press Esc to cancel", "Нажмите Esc для отмены") T("Close the pause menu to run the benchmark.", "Закройте меню паузы, чтобы запустить бенчмарк.") T("In play only", "Только в игре") +T("Camera sweep", "Плавный поворот камеры") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "Плавно поворачивает камеру во время замера для нагрузки на стриминг и LOD вместо статичного вида.") +T("Baseline comparison", "Сравнение A/B") +T("Update baseline", "Обновить эталон") +T("Set baseline", "Задать эталон") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "Сохраняет текущие результаты как эталон для отображения разницы FPS/мс и базовой кривой в следующих прогонах.") +T("Saved current results as baseline.", "Текущие результаты сохранены как эталон.") +T("Clear baseline", "Очистить эталон") +T("Removes the stored A/B baseline comparison.", "Удаляет сохранённый эталон для сравнения A/B.") +T("blue = baseline", "синий = эталон") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/th.inc b/runtime/ui/i18n/th.inc index fc48efc6a..0e4a5a3fe 100644 --- a/runtime/ui/i18n/th.inc +++ b/runtime/ui/i18n/th.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "กำลังคืนตำแหน่ง...") T("Press Esc to cancel", "กด Esc เพื่อยกเลิก") T("Close the pause menu to run the benchmark.", "ปิดเมนูหยุดชั่วคราวก่อนเริ่มการทดสอบประสิทธิภาพ") T("In play only", "เฉพาะขณะเล่น") +T("Camera sweep", "แพนกล้องอัตโนมัติ") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "หมุนกล้องอย่างนุ่มนวลระหว่างวัดผลเพื่อทดสอบการสตรีมและ LOD แทนการมองมุมคงที่") +T("Baseline comparison", "เปรียบเทียบค่าอ้างอิง (A/B)") +T("Update baseline", "อัปเดตค่าอ้างอิง") +T("Set baseline", "ตั้งเป็นค่าอ้างอิง") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "บันทึกผลลัพธ์ปัจจุบันเป็นค่าอ้างอิงเพื่อแสดงผลต่าง FPS/ms และเส้นเปรียบเทียบในครั้งถัดไป") +T("Saved current results as baseline.", "บันทึกผลลัพธ์ปัจจุบันเป็นค่าอ้างอิงแล้ว") +T("Clear baseline", "ล้างค่าอ้างอิง") +T("Removes the stored A/B baseline comparison.", "ลบค่าอ้างอิงสำหรับการเปรียบเทียบ A/B ที่บันทึกไว้") +T("blue = baseline", "สีน้ำเงิน = ค่าอ้างอิง") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/zh-Hans.inc b/runtime/ui/i18n/zh-Hans.inc index 29bab0a23..aa2ee5613 100644 --- a/runtime/ui/i18n/zh-Hans.inc +++ b/runtime/ui/i18n/zh-Hans.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "恢复位置中...") T("Press Esc to cancel", "按 Esc 取消") T("Close the pause menu to run the benchmark.", "请先关闭暂停菜单再运行基准测试。") T("In play only", "仅游玩时") +T("Camera sweep", "镜头扫视") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "在测量期间缓慢平移镜头,以测试资源流式加载和 LOD,而非固定视角。") +T("Baseline comparison", "基线对比 (A/B)") +T("Update baseline", "更新基线") +T("Set baseline", "设为基线") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "将当前结果存为参考基线,以便在后续测试中显示 FPS/ms 差值和基线曲线。") +T("Saved current results as baseline.", "已将当前结果保存为基线。") +T("Clear baseline", "清除基线") +T("Removes the stored A/B baseline comparison.", "移除已保存的 A/B 基线对比。") +T("blue = baseline", "蓝色 = 基线") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%") diff --git a/runtime/ui/i18n/zh-Hant.inc b/runtime/ui/i18n/zh-Hant.inc index 40e9aa2ac..214436847 100644 --- a/runtime/ui/i18n/zh-Hant.inc +++ b/runtime/ui/i18n/zh-Hant.inc @@ -1617,3 +1617,14 @@ T("Restoring position...", "恢復位置中...") T("Press Esc to cancel", "按 Esc 取消") T("Close the pause menu to run the benchmark.", "請先關閉暫停選單再執行基準測試。") T("In play only", "僅遊玩時") +T("Camera sweep", "鏡頭掃視") +T("Gently pans the camera during measurement to stress streaming and LODs instead of holding a fixed view.", "在測量期間緩慢平移鏡頭,以測試資源串流與 LOD,而非固定視角。") +T("Baseline comparison", "基準對比 (A/B)") +T("Update baseline", "更新基準") +T("Set baseline", "設為基準") +T("Stores the current results as a reference to show FPS/ms deltas and a baseline curve on future runs.", "將目前結果存為參考基準,以便在後續測試中顯示 FPS/ms 差值與基準曲線。") +T("Saved current results as baseline.", "已將目前結果儲存為基準。") +T("Clear baseline", "清除基準") +T("Removes the stored A/B baseline comparison.", "移除已儲存的 A/B 基準對比。") +T("blue = baseline", "藍色 = 基準") +T("<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%", "<8.3ms: %.1f%% | 8.3-16.7ms: %.1f%% | 16.7-33.3ms: %.1f%% | >33.3ms: %.1f%%")