Skip to content

Upload shm client buffer to opengl texture with a single glTexSubImage2D()

Vlad Zahorodnii requested to merge work/zzag/shm-complex-buffer-damage into master

Applications that use QtWidgets can have a lot of rectangles in the damage region. For example, when you navigate between directories in Dolphin, each individual file or folder item will be added to the damage region rather than the container view where they are.

On the other hand, issuing multiple glTexSubImage2D() function calls is not great because it means stalling the cpu until the texture upload completes.

This change attempts to improve that by taking the bounding rectangle of the damage and uploading only that part of the shm client buffer.

The gains are not impressive. On my machine, I see fewer 5ms texture upload time spikes when navigating in Dolphin, now I can observe 4ms spikes instead. Still, I believe the change is reasonable enough.

Merge request reports

Loading