Repository navigation
fix(win32): feed drag-resize frames to RUNE_FRAME_LOG, use capacited texture ring, and harden fallback - #2309
Merged
Conversation
…texture ring, and harden fallback
This was referenced Nov 25, 2026
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
…une and procwatch (#2370) A feature-set warning sweep across Linux, macOS, Windows, and wasm32 found eight dead-code warnings under optional and non-default feature sets: - `crates/rune/src/open_path.rs:203` (`file_uri_from_bytes`, added in #1947): used on Unix only under `feature = "dbus"` (FileManager1) and tests; gate with `feature = "dbus"` alongside `test`. - `crates/rune/src/platform/preferences.rs:77` (`DEFAULT_DOUBLE_CLICK_SECS`, added in #1923/#2128): used on Linux only under `feature = "dbus"` and tests; gate with `all(target_os = "linux", feature = "dbus")` alongside `test`. - `crates/rune/src/window/titlebar/linux.rs:82` (`Sides::ALL`, added in #2244): used only in `linux_tests.rs`; gate with `#[cfg(test)]`. - `crates/rune/src/frame/live_log.rs:33` (`CAPTURED` / `capture_frames`, added in #2309): used only in `window/win32/resize_sync/tests.rs` under `frame-profile`; gate with `#[cfg(all(test, target_os = "windows"))]`. - `crates/procwatch/src/alloc/sites.rs:222,271,413,418` (`report`, `unsampled`, `os::modules`, `os::nt_heaps`, added in #744): `alloc-sites` sampling and dumper are Windows-only; gate the implementation behind `#[cfg(windows)]` with clean `#[cfg(not(windows))]` no-op stubs.
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.
Refs #2113
Follow-up to #2133 after the first live Windows 11 test of
RUNE_RESIZE_SYNC=1. Leaves the opt-in off by default with no public API changes.1. Presented-frame consumers fed by the drag path (
crates/rune/src/window/win32/resize_sync/frame.rs)RUNE_FRAME_LOG/FrameProfile(frame::live_log)whole: "drag resize sync")SurfaceMeterpresented()onlyredraw(),presented(),set_pacing()FrameReports(App::on_frame_encoded)set_refresh(),stamp(),drawn()FrameClock::presented_coreRuntimeCore::interaction_presented(hitch/jank)Trace(frame_timed_core-> writer thread, #2297)App::on_frame_drawn(inspect_frame)PaintKeepdebug check &loop_checkedloop_checkednot drainedFrameProfile::take_loop_checkDamage::resetonlyRenderer::damage_drawn()+Damage::reset()Rest,frame_presented,gpu_events::presented,haptics::flush_live,warm_effects,pre_present_notify2. Eliminating per-step shared-texture reallocations (
gpu.rs,present.rs,render/pass.rs)SharedDragTarget(reallocated viaCreateCommittedResource+CreateSharedHandle+OpenSharedResource1on every pixel size change) with a capacited 2-slotDragTargetRing(256 px growth steps with headroom, exact size kept only for custom compositors) rendered via sub-rectangle viewport/scissor (render/pass.rs::apply_subrect_viewport) and copied viaCopySubresourceRegion.DxgiDragSwapChain::ensure_size(ResizeBuffers) ahead ofBeginPaint/EndPaint, and added a non-blockingPollType::Pollafter each drag present so wgpu reclaims finished command allocators during long drags.--profile perfmeasurement (5 pairs × 120 resize steps, 640×480 ↔ 1112×596, BGRA8, real DX12+D3D11 adapter):CopySubresourceRegion)IDXGISwapChain1::ResizeBufferson theDXGI_SWAP_EFFECT_DISCARDHWND swap chain (required per size step because Microsoft Learn documentsDXGI_SCALING_NONEas flip-model only),BeginPaint/Present(0, 0)/EndPaintinto a live HWND redirection surface, and DWM's vblank composition deadline (occasional late steps at high refresh rates remain an inherent limit of the documented copy-model path).3. Fallback & eligibility hardening (
machine.rs,resize_sync.rs)(State::Dragging, Event::DragFailed)inmachine.rs: transitions toState::IdlewithAttachDcomp+ReleaseDragResourcesinstead of falling through to a no-op and leaving DirectComposition detached.l.configrollback on failed drag steps (commit_or_rollback_config): trackssurface_size_before_dragso a fallback toWin::resize_surfacenever sees stale dimensions and skipsResizeBufferson the normal D3D12 swap chain.DeviceType::Cpu) and non-8-bit (HDR) surface formats inresize_sync_eligibility.RUNE_RESIZE_SYNCunset or0, zero D3D11 devices, shared textures, or second swap chains are created.