Repository navigation
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
Use nonblocking device maintenance after presenting in both GPU Vello window renderers. Surface acquisition still supplies bounded presentation backpressure while the CPU can prepare the next frame before the previous submission completes. Assisted-by: Codex/gpt-5
…t; skip acquire/blit stages without an intermediate texture; drop the poll stage
staging-devin-ai-integration
Bot
force-pushed
the
devin/1792538931-gpu-frame-timer
branch
from
October 20, 2026 23:49
ddd2a3b to
b3fee79
Compare
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.
Summary
Follow-up to #92 (whose commit is included here, since its branch lives on a fork). Once the post-present poll is nonblocking the
log_frame_timestimer loses its only GPU figure (the oldwaitstage was effectively "submit → GPU done"), andpresentlumps the swapchain acquire wait in with the actual present. This restores both, foranyrender_velloandanyrender_vello_hybrid:acquirestage. With an intermediate texture the surface is acquired explicitly (ensure_current_surface_texture) between vello's submit and the blit, soacquireis the drawable wait andpresentis just the blit submit + present. Without one (SurfaceRenderer::has_intermediate_texture() == false)target_texture_view()already acquired, soacquireis recorded right after it and no blit stage is timed. Thepollstage is dropped: withPollType::Pollit measures 5–30µs.gpu render/gpu blit(previous frame). Newwgpu_context::GpuFrameTimer, compiled only with the newwgpu_context/log_frame_timesfeature (enabled by both renderers'log_frame_times); a no-op struct otherwise.submittedregisters aQueue::on_submitted_work_donecallback that recordsstart.elapsed(). Because wgpu only runs those callbacks fromsubmit/poll, a plain callback would read "time until the next frame's poll" (measured 15–19ms for an empty hybrid frame). So on native the timer spawns onegpu-frame-timerthread thatdevice.poll(PollType::Poll)s every 250µs while anything is in flight and parks otherwise. It deliberately never usesPollType::Wait: wgpu-core's wait holds the snatch read lock for the duration whilequeue.presentneeds the write lock, so a blocking poll on another thread would stall present on the main thread. On wasm callbacks are driven by the browser, no thread.The figure is wall-clock submit→completion observed by wgpu (+ up to 250µs polling granularity), i.e. an upper bound on GPU time, not a timestamp query. Exact GPU timings would need
TIMESTAMP_QUERY(vello'swgpu-profilerintegration uses encoder-level queries, which Apple GPUs don't support).Measurements
bunnymark, release build, macOS/Metal, 60 Hz. Medians over ~2k+ frames per cell; frame total is vsync-bound at ~17ms, almost all of it in
acquire(13–19ms waiting for a drawable).Sample output:
Checks
cargo fmt --check,cargo clippy --workspace -D warnings, and clippy withanyrender_vello/log_frame_times,anyrender_vello_hybrid/log_frame_timespass locally. wasm not built locally (no target installed); the wasm path is the no-opwake_poller.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/c025c1dce5e8468bb851c75a4d4f9112
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/c025c1dce5e8468bb851c75a4d4f9112?variant=devin-insiders
Requested by: @nicoburns