Skip to content

Respect WindowBuilder vsync in render surface configuration#175

Merged
vmarcella merged 2 commits intomainfrom
vmrcella/fix-vsync-in-render
Feb 7, 2026
Merged

Respect WindowBuilder vsync in render surface configuration#175
vmarcella merged 2 commits intomainfrom
vmrcella/fix-vsync-in-render

Conversation

@vmarcella
Copy link
Member

@vmarcella vmarcella commented Feb 7, 2026

Summary

Fixes vsync configuration being effectively ignored in some cases by ensuring
the requested present mode is respected end-to-end and that “vsync off”
fallbacks prefer true non-vsync modes when available.

Related Issues

Changes

  • Respect window vsync preference when building a RenderContext (when no explicit present mode is set).
  • Prefer AutoNoVsync over Mailbox when the caller requests non-vsync presentation but the adapter does not support Immediate.
  • Add unit tests covering present mode resolution and platform present-mode fallback ordering.
  • Clarify WindowBuilder::with_vsync docs (best-effort based on platform capabilities).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (updates to docs, specs, tutorials, or comments)
  • Refactor (code change that neither fixes a bug nor adds a feature)
  • Performance (change that improves performance)
  • Test (adding or updating tests)
  • Build/CI (changes to build process or CI configuration)

Affected Crates

  • lambda-rs
  • lambda-rs-platform
  • lambda-rs-args
  • lambda-rs-logging
  • Other:

Checklist

  • Code follows the repository style guidelines (cargo +nightly fmt --all)
  • Code passes clippy (cargo clippy --workspace --all-targets -- -D warnings)
  • Tests pass (cargo test --workspace)
  • New code includes appropriate documentation
  • Public API changes are documented
  • Breaking changes are noted in this PR description

Testing

Commands run:

cargo test -p lambda-rs-platform --lib
cargo test -p lambda-rs --lib

Manual verification steps (if applicable):

  1. (Optional) Run a demo with WindowBuilder::with_vsync(false) and confirm frame pacing is no longer refresh-capped on platforms that support non-vsync modes.

Screenshots/Recordings

N/A

Platform Testing

  • macOS
  • Windows
  • Linux

Additional Notes

…that vsync/no vsync requests are more likely to be satisfied
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

✅ Coverage Report

📊 View Full HTML Report (download artifact)

Overall Coverage

Metric Value
Total Line Coverage 45.35%
Lines Covered 5064 / 11166

Changed Files in This PR

File Coverage Lines
crates/lambda-rs-platform/src/wgpu/surface.rs 26.71% 74/277
crates/lambda-rs/src/render/mod.rs 8.42% 58/689
crates/lambda-rs/src/render/window.rs 0.00% 0/63

PR Files Coverage: 12.82% (132/1029 lines)


Generated by cargo-llvm-cov · Latest main coverage

Last updated: 2026-02-07 22:01:48 UTC · Commit: 153dc64

@vmarcella vmarcella added lambda-rs Issues pertaining to the core framework lambda-rs-platform Issues pertaining to the dependency & platform wrappers render All things render related labels Feb 7, 2026
@vmarcella vmarcella merged commit 0392012 into main Feb 7, 2026
10 checks passed
@vmarcella vmarcella deleted the vmrcella/fix-vsync-in-render branch February 7, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lambda-rs Issues pertaining to the core framework lambda-rs-platform Issues pertaining to the dependency & platform wrappers render All things render related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] WindowBuilder::with_vsync is a no-op; present mode hardcoded to Fifo

1 participant