mesa: workaround GL_INVALID_OPERATION in GLES 2.0 draws

Mesa internally converts some draw calls to DrawArraysInstancedBaseInstance
or DrawElementsInstancedBaseVertexBaseInstance, which are only available
in GLES contexts via GL_EXT_base_instance, a GLES3-only extension.

Export these two functions into the internal namespace for GLES 2.0
contexts too.

This fixes black screen for `glmark2-es2 -b build:use-vbo=false` (which is
the first test item for glmark2 auto test sequence) on GLES 2 HW / GLES
3 HW with MESA_GLES_VERSION_OVERRIDE=2.0 .

Fixes: 7c1f8b63ad ("glthread: work around GL_INVALID_OPERATION with OpenGL ES 1.x draws")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39092>
This commit is contained in:
Icenowy Zheng 2025-12-27 09:06:41 +08:00 committed by Marge Bot
parent c3763b12e2
commit 2c770a8dce

View file

@ -10989,7 +10989,7 @@
<!-- These functions exist because glthread converts all draws to these
and then calls them through the dispatch table, so this is a workaround
for the GL_INVALID_OPERATION errors with OpenGL ES 1.x. -->
<function name="InternalDrawArraysInstancedBaseInstance" es1="1.0"
<function name="InternalDrawArraysInstancedBaseInstance" es1="1.0" es2="2.0"
alias="DrawArraysInstancedBaseInstance">
<param name="mode" type="GLenum"/>
<param name="first" type="GLint"/>
@ -10998,7 +10998,7 @@
<param name="baseinstance" type="GLuint"/>
</function>
<function name="InternalDrawElementsInstancedBaseVertexBaseInstance" es1="1.0"
<function name="InternalDrawElementsInstancedBaseVertexBaseInstance" es1="1.0" es2="2.0"
alias="DrawElementsInstancedBaseVertexBaseInstance">
<param name="mode" type="GLenum"/>
<param name="count" type="GLsizei"/>