Usability Improvements, Scaling Filters, and Memory Leak Fix#15
Open
CobaltDelta wants to merge 5 commits into
Open
Usability Improvements, Scaling Filters, and Memory Leak Fix#15CobaltDelta wants to merge 5 commits into
CobaltDelta wants to merge 5 commits into
Conversation
- build.rs now embeds the .ico into a .rc manifest - create_window now retrieves the .ico from the exe - the mouse cursor is hidden whenever idle for 3 seconds, unless the menu is opened - when the window is in focus or fullscreened, ES_DISPLAY_REQUIRED is passed to SetThreadExecutionState to prevent display sleeping - added a panic hook to logger to capture fatal panic information - cargo clippy/fmt applied
Updates the wgsl shader to apply bilinear, bicubic, or lanczos filtering to the frame. Routed through a new settings field and an enumeration.
Replace the unbounded crossbeam channel between the capture thread and
the render loop with a lock-free SPSC triple buffer. The unbounded
channel allowed multi-MB frames to accumulate without bound when the
event loop was slower than the capture rate.
Changes:
- Add src/triple_buffer.rs: lock-free SPSC triple buffer
- Replace unbounded frame channel with triple buffer (3 frames max)
- Event-driven redraws via EventLoopProxy instead of spin loop
- Add decode_into() for zero-alloc readback via triple buffer recycling
- Refactor dx12_interop handle lifecycle: split ephemeral NT handles
(ImportHandleSet with Drop) from long-lived layout metadata
(SharedBufferLayout), making handle leaks impossible by construction
- Adaptive Lanczos shader: 2-lobe at <=2x upscale, 3-lobe at >2x;
bypass custom filters when downscaling (ratio <= 1)
- Fix redundant uniform write (format_mode only, not full struct)
- Remove unnecessary Clone on CaptureSource (was forcing the handles
into a Clone-requiring struct)
When the window is minimized or occluded, do not submit a frame to the renderer at all - consume it from the triple-buffer but discard the result. On any soft wgpu SurfaceErrors, flush any pending frames using an empty submit() This prevents the SurfaceError::OOM panic that can occur if the display goes to sleep during a capture.
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.
See individual commit messages for details.
This is a grab bag of tweaks and improvements. Of note: