Repository navigation
Custom renderer follow-ups: present handed-over GL textures, restore manual refresh mode - #92
Merged
diiviocity merged 2 commits intoOct 21, 2026
Conversation
set_gl_surface_texture only recorded the request; the new texture reached the screen when the next drawn frame synced it. On GL/D3D that arrives with the per-vsync re-present, but on Metal an idle on_demand window draws nothing and the update would sit until unrelated work invalidated the window. Ask for one frame from the producer side — the scheduler's queue is mutex guarded, so the ask is safe from the player thread.
.manual restores the fully ask-driven loop the on_demand mode had before the scheduler took over: gg's ui_mode suppresses the frame callback between asks, refresh()/request_refresh() wake it through the coordinator's new wake_fn hook, and pending visual deadlines schedule their own one-shot wake via the after() timer. on_demand and continuous keep flowing frame callbacks and stay gated by the coordinator. Also fixes the double ui_mode key the merge left in new_context.
diiviocity
force-pushed
the
feat/custom-renderer-followups
branch
from
October 21, 2026 01:25
032d240 to
678216e
Compare
diiviocity
added a commit
that referenced
this pull request
Oct 21, 2026
V has no Go-style if-let: the checker rejected the statement expression introduced in #92 and the calculator example failed to build. Split it into a plain binding plus an if.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #47 (stacked on its integration commit — merge #47 first; this diff shrinks to these two commits once it lands).
gl_surface: present a handed-over texture without waiting for other work
set_gl_surface_textureonly recorded the request; the new texture reached the screen when the next drawn frame synced it. On GL/D3D that arrives with the per-vsync re-present, but on Metal an idle on_demand window draws nothing and the update would sit until unrelated work invalidated the window. The producer's update now asks for one frame itself — the scheduler's queue is mutex guarded, so the ask is safe from the player thread.Add the manual refresh mode back on top of the frame scheduler
RefreshMode.manualrestores the fully ask-driven loop the old on_demand mode had: gg's ui_mode suppresses the frame callback between explicit asks (fully dark idle on GL too),refresh()/request_refresh()wake the loop through the coordinator's new mutex-guardedwake_fnhook, pending visual deadlines (tooltips, long-press) and running animations schedule their own continuation wakes, and the keep-alive thread stays off.on_demandandcontinuouskeep flowing frame callbacks gated by the coordinator. Also fixes the doubleui_mode:key the merge had left innew_context.Verified: full tree parses clean under the latest upstream V (
v fmt -c); the scheduler design was runtime-verified earlier (test files + the acceptance fixture under xvfb). Note the upstream V compiler panic/hang on full-module builds of current master is repo-wide and predates both PRs.