Re: EGL partial_update vs. swap_buffers_with_damage and amdgpu support
Pekka Paalanen <[email protected]> Mon, 27 Jan 2025 11:28:58 +0200
| Newsgroups | gmane.comp.video.mesa3d.user |
|---|---|
| Message-ID | <20250127112858.799fa70a@eldfell> |
--Sig_/gTljrTRbEdbKE9Ic4Qc1H8l Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, 26 Jan 2025 10:37:39 -0600 Charlie McMackin <[email protected]> wrote: > On Sun, Jan 26, 2025 at 9:28=E2=80=AFAM Pekka Paalanen > <[email protected]> wrote: > > =20 > > 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. > > =20 > Ah, this is definitely one key I didn't know. So, I shouldn't be > missing out on any ability to only update damaged areas of a > framebuffer without the partial_update extension...the main key is > using buffer_age to determine what my render loop should draw and the > other two are more for hinting to compositors that support it / are > more nice-if-you-have-it? Exactly. If you don't have buffer_age, or it gives you zero as the age, or the age is greater than the damage history you keep, you need to do a full draw. Alternatively, one could set the EGL surface attribute EGL_SWAP_BEHAVIOR to EGL_BUFFER_PRESERVED when supported, and always draw only the latest updates, but it also implies that the EGL implementation needs to do a full copy of the buffer at each swap. Using buffer_age can be more optimal than that, at the cost of increased code complexity. A word of caution: ordering your EGL calls is very important when you need to resize the window. When you query buffer_age, EGL determines which buffer you are going to draw to next. Once the next buffer is determined, you cannot resize it. Any resize call will apply after the next swap. Also any OpenGL drawing command will determine the next buffer if it wasn't already, and I assume this is well-known, but an EGL call doing it can be a surprise. There might be other EGL calls doing it as well, so the most reliable place to resize is immediately after a swap. > Thanks again! No problem, pq --Sig_/gTljrTRbEdbKE9Ic4Qc1H8l Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAmeXUdoACgkQI1/ltBGq qqc3Pg//aGALSRbmeqxF9H/4N4qak0DrZyJqk1Z0fciv8io6U/U1RiUcWh0k5lW9 Bo48/Qd8eIICCj6reHBs+FZVXzoULspzaZHw/fdhgeJDyHjnb3afdyJ/0A2vb5s+ vgRV6xqoHuDvCqTaNJ638a0xTdpT2IrwcUpqmE9VJKDV49CP0ZlfXcJLGPMkcdym L8AQJmWXBLVep7NbpCkjBuAJqydbcuWStHTFNBiBvr1VXfaNkTfs14IhJV+axicx Z0jPrZoMAeKEaJbc0jWiG7nHomaW7DjHyPvVfNhGZ0dhuOzHpZll3dGRyNdNsqyi 4mf1Jsa10g8aC3kCx8WifOX3UiLR9+sR92/gZLocMrIbOA4M5ZYy7mO9sSIklQc5 o2cW3K+nUUGwRSxwXr/Z6yiUn/WfWa7U1TCkMvx74BtSB73ZaZyFvGBzXEKToslZ zNFIhQmXxv0b2202KG7ZwhmsTcX+zc8WkbMTP/IxwWXjbdd91qKBbeMoYYgQQgSm KTO5/9d1/njO76WjvmYSItVxQD5auFEUcBVFot7YNdl1u9A4IaBulExgSPHZ4W/U k5vW4Olgx5Y2h8zIqt5C6fU75M0uIIVamMK38K1wSQxdFqTJu6P4I5ClEuJ128+r R0gtKK9ekyqUBzVKuXb/BSyrJWv/qlO03huRwcPDf9ZNxYyiiHA= =CKA9 -----END PGP SIGNATURE----- --Sig_/gTljrTRbEdbKE9Ic4Qc1H8l--