Skip to content
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

Fix wlr_render_pass regressions #7580

Merged
merged 2 commits into from May 9, 2023

Conversation

kennylevinsen
Copy link
Member

Two regression fixes:

  1. Apply clip properly without affecting the projection matrix
  2. Clear using the proper dimensions when scaling is in use

Seems to do the trick locally.

The new wlr_render_pass API provides src_box, dst_box and clip
parameters for texture rendition. Rather than clipping the dst_box,
which control the projection matrix and leads to compression, intersect
the damage and clip box and pass these as a clip parameter.

Fixes: swaywm#7579
Regressed by: swaywm#7552
@emersion
Copy link
Member

emersion commented May 9, 2023

"render: Apply clip to rendered texture correctly" LGTM!

@emersion
Copy link
Member

emersion commented May 9, 2023

Setting scale=1.5 and transform=90, then killing swaybg, reveals that using wlr_output.{width,height} is the right thing to do. With wlr_output_transformed_resolution(), then the cleared rect is invalid:

screenshot

Clear was done using sway_output's logical dimensions, instead of the
wlr_output physical dimensions. This meant that when output scaling was
applied, only a part of the screen would be cleared.

Use the wlr_output dimensions instead.

Regressed by: swaywm#7552
@kennylevinsen
Copy link
Member Author

Setting scale=1.5 and transform=90, then killing swaybg, reveals that using wlr_output.{width,height} is the right thing to do. With wlr_output_transformed_resolution(), then the cleared rect is invalid:

Updated to just change from sway_output->{width, height} to wlr_output->{width, height}

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Thank you so much! I couldn't wrap my head around this bug.

@emersion emersion enabled auto-merge (rebase) May 9, 2023 13:53
@emersion emersion merged commit 0a95151 into swaywm:master May 9, 2023
3 checks passed
@kennylevinsen kennylevinsen deleted the fix-render-pass branch May 9, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants