Mesa (main): st/mesa: allow hardware to claim ES 3.1 without hw indirect draws
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Jun 6 21:34:15 UTC 2021
Module: Mesa
Branch: main
Commit: 503d97445a9c6bfdcbb17968c0469cfc8c303eef
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=503d97445a9c6bfdcbb17968c0469cfc8c303eef
Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date: Sat May 1 19:01:21 2021 -0400
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 at alum.mit.edu>
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10569>
---
src/mesa/state_tracker/st_extensions.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index f0f03420aac..f9cb42cbb99 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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.
*/
More information about the mesa-commit
mailing list