Skip to content

image-copy: Store offscreen buffer for shm capture in session #2185

Open
ids1024 wants to merge 5 commits intomasterfrom
image-copy_noble
Open

image-copy: Store offscreen buffer for shm capture in session #2185
ids1024 wants to merge 5 commits intomasterfrom
image-copy_noble

Conversation

@ids1024
Copy link
Member

@ids1024 ids1024 commented Mar 12, 2026

Requires Smithay/smithay#1960.

Seems okay, but I'm still seeing cursor capture using full damage when nothing has changed. Damage tracking still needs improvement...

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

ids1024 added 3 commits March 11, 2026 20:11
Age for shm capture is defined as `0` in `render_session()`, so we don't
need to also set it 0 here.
Everything implementing `AsGlowRenderer` implements `Renderer` and various
other traits, and by making `AsGlowRenderer` depend on these trait,
things requiring `AsGlowRenderer` can avoid listing those traits as
well.

Looks like implied trait bounds still won't work for the
`Self::TexutureId` and `Self::Error` requirements? So those are not
included here.
Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, this should be a nice performance improvement!

ids1024 added 2 commits March 12, 2026 10:27
Avoid allocating a GPU buffer every frame, and avoid re-rendering
everything.
@ids1024
Copy link
Member Author

ids1024 commented Mar 13, 2026

Any further improvements to damage tracking can be addressed in a later PR. Avoid extra buffer allocations should be a performance improvement regardless, as long as we see no issues here.

I wanted to test this on the darp10 to make sure re-using the buffer didn't get the same graphical corruption issues we we're getting there with dmabuf capture, but it seems I got pop-os/cosmic-workspaces-epoch#280 wrong. And pop-os/cosmic-workspaces-epoch#292 is the correct fix.

So a good way to test this may be on a Meteor Lake system like the darp10 alongside pop-os/cosmic-workspaces-epoch#292, with a window playing an animation. (Which I've done; and it seems good now.)

@ids1024 ids1024 marked this pull request as ready for review March 13, 2026 00:09
@ids1024 ids1024 requested review from a team March 13, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants