-
Notifications
You must be signed in to change notification settings - Fork 5
feat: implement multi-output support with scaling #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
sin-ack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. From what I can tell you're getting help from an LLM for this change. That's fine, but:
- The PR description and commit message seem to be generated too. Please describe the change with your own words. LLMs are good at explaining what happened but they're not good at explaining why.
- Unfortunately LLM providers really like to RL their coding models into doing a single commit for all changes, resulting in a hard-to-review PR because it's more difficult to tell which line of code belongs to which change. Please use atomic commits for each separate change being made. I recommend you to look at this repo's history for how I expect things to be structured. You can ask the LLM about how to modify Git history, or make it do the split by itself (although I wouldn't really trust an LLM to run commands on my behalf,
git reflogis your friend here). - As I detailed below, one of the reasons I kinda postponed working on this was due to not being able to figure out how to handle multiple frame-rate options within the same loop (I had initially planned to spawn multiple threads and run a queue on each). The changes below seem to mostly address that nicely, but they use the same frame-rate for all outputs. Instead, make the
--outputflag configure individual outputs which you can then use as the basis for creatingPaperobjects. - Since as part of the changes the command-line options will change, please make sure to update the README too.
73cf679 to
e69a7f0
Compare
|
TYVM for the review and many thanks for taking the time to help me clean up the slop. I divided the chungus squash commit to be atomic. Independent configurable frame rates works. I tested this on Niri and Hyprland and both work for me. |
|
I tried a few things help the user manage gpu utilization
|
a48baac to
9322251
Compare
47d0801 to
f07eb8b
Compare
- Integrates `nixgl` via overlay to ensure pure evaluation. - Adds `nixGLIntel` wrapper for x86 Linux, enabling execution on non-NixOS distros (like Arch). - Drops the generic `nixGL` auto-detect wrapper as it relies on `builtins.currentTime`, which is impure and fails `nix flake check` in CI. - Updates `flake.lock` with `nixgl` input.
|
Sorry for the lack of a review, I was on a trip. I'll take a closer look at this on Sunday.
The
Some benchmarks for render time would be cool! |
|
Hope you had a good trip! No rush. As you can see the scope of this PR has extended a bit over the week as I tinkered and tried a few ideas, which has been fun and a good learning experience. Thanks for the feedback and for working with me on this! Good point about the Benchmarks on the shared OpenGL context was interesting technically but not so impactful in my case and probably for most desktop users. Sharing the context reduces the cost of switching surfaces on the driver side ~5% reduction from Commit:
Results (Average of 3 runs, Normalized per Render)
edit----
Results (Average of 3 runs, Normalized per Render)
Seems like a win to me |
Description
Papertoy but on multiple displays
independent configuration of frame rate, resolution, and scaling
handles display rotation
tested on Niri and Hyprland, both Nixos and Arch
Per-Output
PaperInstances: Manage each output independently. A newPaperstruct encapsulates all state necessary for rendering on a single output (includingWlrSurface,Shader, and OpenGL contexts). Subsequently decided to try a shared OpenGL context to see if there were any per benefits, if so it wasn't major.Respect Compositor Configuration: The application now correctly processes
zwlr_layer_surface_v1.configureevents, which provide the authoritative logical dimensions from the compositor. This ensures the application always resizes correctly based on compositor instructions.Output Orientation Support: The application now handles
wl_output.geometryevents, which communicate display rotation. It swaps width and height when a display is rotated by 90 or 270 degrees, tested on 3440x1440 vs 1440x3440.wlr_layer_surfaceAnchoring: Layer surfaces are now anchored to all four edges (top,bottom,left,right). This explicitly tells the compositor to stretch the wallpaper to fill the entire output area- this was needed for Niri when the surface might not cover the whole display when in vertical orientation.display scaling: Added a scale parameter to uniformly adjust theresolution.How to Test
1. Performance Mode (Recommended for 4K)
Render at half resolution (1080p on 4K) to save GPU power, but keep the window fullscreen.
$ papertoy shader.glsl --output "id=HDMI-A-1,scale=0.5"2. Multi-Monitor Setup
Configure a high-refresh main monitor and a slower secondary monitor.
3. Custom Resolution
Force a specific aspect ratio or size.
$ papertoy shader.glsl --output "id=DP-1,resolution=800x600"4. All displays at native settings
Automatically render papertoy on all displays
$ papertoy shader.glslVerify that animations are smooth on all displays and that the wallpaper correctly fills the entire screen area, including any fractionally scaled or rotated displays.