Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15, 6.2
-
None
Description
Raster-based Wayland clients running against a QtWayland compositor will normally reuse the same buffer, but SharedMemoryBuffer::toOpenGlTexture() will always re-upload the whole buffer using glTexImage2D(), even if only a small part of the buffer has been damaged.
In order to improve performance, we should use glTexSubImage2D() to update only the part of the texture that has been changed. Uploading a rectangular region of a raster image is done by setting the stride with glPixelStorei(GL_PACK_ROW_LENGTH, stride). Note that this is not available in GLES 2, where we would have to upload a sub-image that has the full width of the buffer.
This will also require some book-keeping to keep track of the dirty region.