st/mesa: allow hardware to claim ES 3.1 without hw indirect draws

Such a driver will be expected to handle indirect draws via emulation.
As such we don't want to expose the ext in desktop GL contexts. However
for ES 3.1 it's a required feature, so makes sense to allow fallbacks.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10569>
This commit is contained in:
Ilia Mirkin
2021-05-01 19:01:21 -04:00
parent 08fe7d72d1
commit 503d97445a

View File

@@ -1301,6 +1301,15 @@ void st_init_extensions(struct pipe_screen *screen,
extensions->OES_geometry_shader = GL_TRUE;
}
/* Some hardware may not support indirect draws, but still wants ES
* 3.1. This allows the extension to be enabled only in ES contexts to
* avoid claiming hw support when there is none, and using a software
* fallback for ES.
*/
if (api == API_OPENGLES2 && ESSLVersion >= 310) {
extensions->ARB_draw_indirect = GL_TRUE;
}
/* Needs PIPE_CAP_SAMPLE_SHADING + all the sample-related bits of
* ARB_gpu_shader5. This enables all the per-sample shading ES extensions.
*/