render: more fine-grained wayland surface damage tracking

Before this patch. Wayland surface damage tracking was done on a
per-row basis. That is, even if just one cell was updated, the entire
row was "damaged".

Now, damage is per cell. This hopefully results in lower latencies in
many use cases, and especially on high DPI monitors.
This commit is contained in:
Daniel Eklöf 2023-10-07 16:23:09 +02:00
parent 1c9d98d57e
commit c50b1f9900
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 75 additions and 50 deletions

13
shm.h
View file

@ -24,7 +24,18 @@ struct buffer {
unsigned age;
pixman_region32_t dirty;
/*
* First item in the array is used to track frame-to-frame
* damage. This is used when re-applying damage from the last
* frame, when the compositor doesn't release buffers immediately
* (forcing us to double buffer)
*
* The remaining items are used to track surface damage. Each
* worker thread adds its own cell damage to "its" region. When
* the frame is done, all damage is converted to a single region,
* which is then used in calls to wl_surface_damage_buffer().
*/
pixman_region32_t *dirty;
};
void shm_fini(void);