buffet / kiwmi

A fully programmable Wayland Compositor
Mozilla Public License 2.0
585 stars 22 forks source link

Use buffer age when rendering #43

Closed ghost closed 2 years ago

ghost commented 3 years ago

This seems to fix the remaining issues from #38.

(The condition was created experimentally, i'm still not quite sure about it -

  1. != -1 (refuse unknown) - didn't work
  2. > 0 is okay for now
  3. might want to add <= 2, because currently damage is for two frames)

Uh, github didn't detect the keyword above. Fixes #38.

buffet commented 2 years ago

I'm not sure I understand this, but it seems to work, haha.

ghost commented 2 years ago

It’s mostly due to the fixed damage = 2. When you always swap two buffers around, it works as expected. But when a new buffer comes to the play (or an old one returns from holidays), you can’t just keep its old state even if damage > 0.

// Just re-read the diff & realised that a buffer on holidays isn’t handled (point 3 in the initial post). Then also the numbers don’t matter so much, it’s just that also the buffer has to be checked, not only the output.