Skip to content

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

@vmarcella

Description

@vmarcella

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 (use PresentMode::Fifo)
  • WindowBuilder::with_vsync(false) should disable vsync (use PresentMode::Immediate or similar)
  • The present mode used by the render surface should respect the user's configuration

Actual Behavior

  • with_vsync is documented as a no-op in crates/lambda-rs/src/render/window.rs:54
  • PresentMode::Fifo is hardcoded in crates/lambda-rs/src/render/mod.rs:140
  • Vsync is always enabled regardless of what value is passed to with_vsync

Reproduction Steps

  1. Create a window with vsync disabled:
    let window = WindowBuilder::new()
      .with_title("Test")
      .with_vsync(false)
      .build()?;
  2. Run the application and observe frame timing
  3. 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_vsync to 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions