diff options
Diffstat (limited to 'src/gui/gui.zig')
| -rw-r--r-- | src/gui/gui.zig | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index be287647..dd21680f 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -2627,7 +2627,14 @@ const Client = struct { /// What the window's input made, applied at once and sent. fn feed(cl: *Client) void { - for (cl.pending.items) |ev| cl.link.input(ev); + for (cl.pending.items) |ev| { + const r = cl.link.r; + const predicted = r.echo.stats.predicted; + cl.link.input(ev); + // PARDES_TEST_LATENCY: the input, and whether it shows at once + // (applied, or its echo predicted), for the frame that shows it. + latencyNote("I {d} {d} {d}\n", .{ r.next_seq - 1, monoNs(), @intFromBool(r.applied == r.pending.items.len or r.echo.stats.predicted > predicted) }); + } cl.pending.clearRetainingCapacity(); _ = cl.texts.reset(.retain_capacity); } @@ -2651,6 +2658,11 @@ const Client = struct { // PARDES_TEST_LATENCY: when a terminal's delta came (an echo's). if (msg == .screen) latencyNote("S {d}\n", .{monoNs()}); cl.link.take(msg); + // And after a unit, the first of its own inputs not confirmed. + if (msg == .unit) { + const r = cl.link.r; + latencyNote("U {d} {d}\n", .{ monoNs(), if (r.pending.items.len > 0) r.pending.items[0].seq else r.next_seq }); + } } cl.taken.clearRetainingCapacity(); if (ended) { |
