Skip to content

Implement surface-invalidation-v1#51

Open
Nefsen402 wants to merge 1 commit intoswaywm:masterfrom
Nefsen402:surface-invalidation
Open

Implement surface-invalidation-v1#51
Nefsen402 wants to merge 1 commit intoswaywm:masterfrom
Nefsen402:surface-invalidation

Conversation

@Nefsen402
Copy link
Copy Markdown
Member

No description provided.

@emersion
Copy link
Copy Markdown
Member

emersion commented Dec 5, 2022

Typo in the commit message: s/invalidated/invalidation/

@Nefsen402 Nefsen402 force-pushed the surface-invalidation branch from ab49f94 to 23f6dbe Compare December 5, 2022 12:08
@Nefsen402 Nefsen402 changed the title Implement surface-invalidated-v1 Implement surface-invalidation-v1 Dec 5, 2022
output->surface_invalidation.serial);
output->committed_width = 0;
output->committed_height = 0;
output->committed_scale = 0;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm, why do we need to reset these?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, to trigger the buffer_change bool below?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we can add || output->surface_invalidation.needs_ack to the buffer_change condition?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In the render loop, it will compare the old committed_state with whatever it wants to render now, If the results are the same it will simply commit and return early. This is not good enough: we need to make sure that the render_frame function goes all the way through to create a buffer and commit. Just flipping the buffer_change isn't good enough, took me a while to debug that.

if (output->surface_invalidation.needs_ack) {
output->surface_invalidation.needs_ack = false;
wp_surface_invalidation_v1_ack(output->surface_invalidation.object,
output->surface_invalidation.serial);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be a bit nicer to move this to render_frame.

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.

2 participants