Skip to content

gallium/dri2: implement EGL_KHR_mutable_render_buffer

Yiwei Zhang requested to merge zzyiwei/mesa:mutable_render_buffer into main

On Android in Chrome OS, low latency GPU library needs this extension to be able to toggle front-buffer rendering.

1st commit in gallium/st adds a back buffer fallback for front rendering. All the gallium frontends will early return if the st_attachment_type is not ST_ATTACHMENT_FRONT_LEFT during flush_front to ensure no behavior change.

2nd commit in gallium/dri tweaks the dri frontend to flush the back buffer if the buffer is a shared buffer bound to the context, and it triggers the extension loader's displaySharedBuffer api.

3rd commit in egl/android updates the dri2/platform_android to enable the extension only when the below conditions are met:

1. Driver part implementation of this extension is available
2. Loader part implementation of this extension is available
3. ClientAPIs must be OpenGL ES bits (ES, ES2 or ES3)
4. Gralloc is cros gralloc and it supports front render usage query (optional as long as a similar query is supported)

Test: no regression in dEQP-EGL.functional.* Test: passing dEQP-EGL.functional.mutable_render_buffer.*

Prior related work: https://lists.freedesktop.org/archives/mesa-dev/2018-July/201379.html

/cc @chadversary @robclark @anholt @olv

Edited by Yiwei Zhang

Merge request reports