-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
The WindowBuilder::with_vsync method accepts a boolean parameter but has no effect on the actual present mode. Render surfaces always configure PresentMode::Fifo regardless of the vsync setting, making it impossible for users to disable vsync or control presentation timing.
Expected Behavior
WindowBuilder::with_vsync(true)should enable vsync (usePresentMode::Fifo)WindowBuilder::with_vsync(false)should disable vsync (usePresentMode::Immediateor similar)- The present mode used by the render surface should respect the user's configuration
Actual Behavior
with_vsyncis documented as a no-op incrates/lambda-rs/src/render/window.rs:54PresentMode::Fifois hardcoded incrates/lambda-rs/src/render/mod.rs:140- Vsync is always enabled regardless of what value is passed to
with_vsync
Reproduction Steps
- Create a window with vsync disabled:
let window = WindowBuilder::new() .with_title("Test") .with_vsync(false) .build()?;
- Run the application and observe frame timing
- Notice that vsync is still enabled (frames are capped to display refresh rate)
Code Sample
``rust
// This should disable vsync but doesn't
let window = WindowBuilder::new()
.with_title("No Vsync Test")
.with_vsync(false) // No-op: vsync remains enabled
.build()?;
// Expected: uncapped frame rate, possible tearing
// Actual: frames capped to 60Hz (or display refresh rate)Environment
- OS: Any (macOS, Windows, Linux)
- Rust version: Any supported version
- GPU: Any
- Graphics backend: Any (Vulkan, Metal, DX12)
- lambda-rs version: Current main branch
Affected Crates
lambda-rs
Logs and Output
No error messages; the API silently ignores the vsync setting.Additional Context
- Platform probing fallback exists in
configure_with_defaults(...)and could be leveraged for the fix - Fix should either:
- Connect
with_vsyncto actual present mode selection, or - Add
RenderContextBuilder::with_present_mode(PresentMode)for explicit control - Map
with_vsync(true)→Fifo/AutoVsync,with_vsync(false)→Immediate/AutoNoVsync
- Connect
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working