Re: EGL partial_update vs. swap_buffers_with_damage and amdgpu support
Pekka Paalanen <[email protected]> Sun, 26 Jan 2025 17:28:42 +0200
| Newsgroups | gmane.comp.video.mesa3d.user |
|---|---|
| Message-ID | <20250126172842.3604429b@tisha> |
--Sig_/=X.=t8Vb05vhx+3zR1LfZ7C Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 26 Jan 2025 08:52:31 -0600 Charlie McMackin <[email protected]> wrote: > Hello, >=20 > I am writing a Wayland+EGL+OpenGL app and am beginning my foray into > rendering only the areas that need updating. I am a little perplexed > trying to figure out which extension(s) my GPU supports. >=20 > 1. When I run `eglinfo` should I see "EGL_KHR_partial_update" in the > extension list if partial update is supported? I believe so, yes. > All the symbols mentioned in the registry for extension 83 seem to > refer to BUFFER_AGE_KHR or eglSwapBuffersWithDamageKHR... and is very > similarly worded to extension 84. So I'm not sure if I need to see > this specific extension or if having EGL_EXT_buffer_age and > EGL_KHR_swap_buffers_with_damage is enough. We need to distinguish two fundamental "damage" areas: - the areas of a buffer that you will draw, and - the areas of a buffer that will be different from the current contents of the window (wl_surface) This distinction is the key to understanding, and the EGL extension docs try to make it clear. Usually applications, and EGL internally, will use a pool of buffers, around two to four in most cases. In Wayland, once EGL has posted a buffer to the display, (E)GL is not allowed to draw into that buffer util the Wayland compositor says it won't need it anymore. Often, you need to draw and post again before the previous buffer is released. Therefore EGL needs another buffer to draw into in the meanwhile. EGL hides all these details from you, you cannot observe buffers on the EGL Wayland platform yourself. buffer_age is the EGL extension that tells you how many swaps ago this buffer was last posted, IOW, how old contents does it have. The application needs to keep account on the history of the changes (damage) to the window, so that it knows exactly which areas of the buffer need to be drawn to make it fully up-to-date. This is usually more than just the change you want to draw for the next frame. In summary, you need to draw more areas than you actully want to update on screen. Partial_update extension allows you to tell EGL which areas of the buffer you are going to draw. Regardless of whether partial_update is supported, you need to track that damage anyway to know what to draw. swap_buffers_with_damage extension tells the window system which areas of the window are being updated. The window system may save some effort and skip processing areas that you say are not updated. However, on Wayland the buffer must be fully up-to-date regardless of what you draw or what you claim changed, because the Wayland compositor is always allowed to read the full contents. >=20 > 2. If "yes" is the answer to 1, is there a known reason why an AMD > Renoir level graphics chip wouldn't show support for > EGL_KHR_partial_update ? Not all GPUs benefit from the partial_update information, it depends on the GPU hardware design. Usually so called "tiler" GPUs can benefit from it, while "immediate mode" GPUs don't (I hope I got the term right). AMD tends to be in the latter group. Thanks, pq --Sig_/=X.=t8Vb05vhx+3zR1LfZ7C Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAmeWVKoACgkQI1/ltBGq qqcJRxAAq3WWEgX9ZuttKuCbntd5FV3f0hBwiuipEyNpXhyNsHI8RH8B8AKDx5Xs 987vPRWl6Ds2sG7uDQNc/5dkBNiqMmCF8On5HyxuByHiCOzNBAzCk42zbbr6k58Z YoHjSrj+g5HDxfD1xWe6/uAXYvPTeR9YVa/429oDCdK14AaWGs4XQo7DRaYywuqL fNuZgJWVj7esNAwKs+m8AHAZrHrXKmiczQ3+asLq5p/vGPwIRkKnMjRFEK0Hzt7J EdR3FMM1ttdO4tJsJ6zRvVqHcJyj5ge/4dmUOhb6jIzUCrg8lRfSqUKqq5wNJ6gF T28ilBlQY7uc7bGeOqJZ4TJGS6dd1x/zcOTWD3ASbzpc2PJWbDMLeXQNm/eaMDD/ V1vx4AYyyfQYWb/aAVI3w+kfeRhl+XFDgq5SOYDVipKRYLZT88CspAYBqtw7/3IF g12v5M6Ad+Ml+iRXu14jTaWgUCHx0oP5u3qMghwvv7I1656diDzGp1TSizcI4UU+ 2F9BUmKEBx4kY6oTFKBNkUiNcmWdfbVx/cp7arJoyv+U3nKqHlRbBIPNKzZyjtt0 /10rO5v/m8LmK/kic7MTZCrZWJlaW4J/8xk5lgjwcNTg//GZUdZ2CHdG+21nkLmh ZhFUIsvrwpQaTBcj7qhdYOp2f+ZTTqEK4oEoJ4u8Pb7lL8FdUTI= =QGV2 -----END PGP SIGNATURE----- --Sig_/=X.=t8Vb05vhx+3zR1LfZ7C--