diff options
Diffstat (limited to 'core/Kind.zig')
| -rw-r--r-- | core/Kind.zig | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/Kind.zig b/core/Kind.zig index 7641c2d1..81997afb 100644 --- a/core/Kind.zig +++ b/core/Kind.zig @@ -136,7 +136,7 @@ pub const Slot = struct { // jobs' inputs, its file's hash, a placeholder's record), and what // a frame makes (the thumb, the pointer, whether one was drawn: a // view's, never a step's). - .local = .{ "ops", "st", "gpa", "arena", "plain", "file", "opened", "reloads", "jobs", "record", "thumb_at", "thumb_span", "pointer", "painted", "over", "used", "draws" }, + .local = .{ "ops", "st", "gpa", "arena", "plain", "file", "opened", "reloads", "jobs", "record", "thumb_at", "thumb_span", "pointer", "painted", "over", "used" }, }; /// Its kind's code here; null in a placeholder (`live` false: its kind /// not in the registry, its record kept for the day it comes) or a @@ -198,11 +198,6 @@ pub const Slot = struct { /// whether a frame was painted since its last tick. pointer: u8 = 0, painted: bool = false, - /// The last of its draws' tokens (api.draw), each its own process's: a - /// draw is a frame's, and how many frames each process paints differs, - /// so it is in no digest; the copy holds it with the slot. A kind - /// keeping one in its state (PA_PLAIN) is caught at that call's digest. - draws: u32 = 0, /// Each view's facts (a hash of its pa_view) as `view` was last told /// them, 0 for none: a change tells it again. views: [views.max]u64 = @splat(0), @@ -1220,8 +1215,8 @@ pub const api: c.pa_api = .{ heap.free(copy); return 0; }; - cl.slot.draws = (cl.slot.draws +% 1) & ~c.PA_DRAWN; - const token = c.PA_DRAWN | cl.slot.draws; + drawn = (drawn +% 1) & ~c.PA_DRAWN; + const token = c.PA_DRAWN | drawn; j.* = .{ .gpa = heap, .pane = @intCast(cl.id), .serial = pane.serial, .token = token, .gen = cl.slot.gen, .ops = ops, .in = copy, .arena = .init(heap), .draw = p }; Addon.holdJob(ops, true); if (drawer) |d| if (d.go(d.ctx, j)) return token; @@ -1250,6 +1245,12 @@ pub const api: c.pa_api = .{ pub var drawer: ?struct { ctx: ?*anyopaque, go: *const fn (ctx: ?*anyopaque, j: *host_io.KindJob) bool } = null; /// Draws done, each kept for its pane's next paint (the loop's alone). var ready: std.ArrayListUnmanaged(*host_io.KindJob) = .empty; +/// The last token a draw was given: a draw is a frame's, this process's, in +/// no digest and no copy (a kind keeping one in its PA_PLAIN state is +/// caught at that call's digest). A rollback takes a slot back, never this, +/// so no draw is given the token a discarded speculation's frame was, whose +/// answer may come after. +var drawn: u32 = 0; /// A draw done on a worker, back on the loop: kept for its pane's next /// paint, a frame owed. One of another core's (a client joined again |
