fix: use wgpu renderer on macOS to prevent idle crash#662
fix: use wgpu renderer on macOS to prevent idle crash#662PastaPastaPasta merged 4 commits intodashpay:v1.0-devfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a macOS-specific eframe dependency with Wgpu and persistence features in Cargo.toml, and conditionally selects the Wgpu renderer in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Switch from glow (OpenGL) to wgpu renderer on all platforms to avoid platform-specific rendering issues such as EXC_BAD_ACCESS crashes in NSOpenGLContext during idle/sleep/display changes on macOS. Closes dashpay#629
7f42e83 to
fd25fde
Compare
|
It starts on Ubuntu. |
The NSOpenGLContext idle/sleep crash (dashpay#629) is macOS-specific, so only switch to the wgpu renderer on macOS. Other platforms keep the default glow (OpenGL) renderer, avoiding unnecessary dependency overhead.
Remove macOS-only cfg guard — wgpu is now the renderer for all platforms, not just macOS.
Issue
Closes #629
Summary
Switch the eframe renderer from OpenGL/glow to wgpu (Metal) on macOS to prevent
EXC_BAD_ACCESScrashes during idle/sleep/display changes.Changes
wgpufeature oneframeinCargo.tomlnative_options.renderer = eframe::Renderer::Wgpuon macOS via#[cfg(target_os = "macos")]Root Cause
The crash artifact from #629 shows a
SIGSEGVon the main thread inNSOpenGLContext flushBuffer→glutin/eframeglow integration, triggered during macOS display reconfiguration (_displayChangedSoAdjustWindows) after idle/sleep. Using Metal via wgpu avoids this OpenGL code path entirely.Validation
wgpufeature enabled (cargo build).EXC_BAD_ACCESSinNSOpenGLContext flushBufferas described in crash on mac when it was idled #629.native_options.renderer = eframe::Renderer::Wgpu, repeated the same idle/sleep/wake cycle on macOS. The application remains stable — no crash, no rendering artifacts. The wgpu/Metal backend avoids the OpenGL code path entirely.Summary by CodeRabbit
Bug Fixes
Improvements