mesa: expose support for OES/EXT_draw_elements_base_vertex to OpenGL ES
authorRyan Houdek <sonicadvance1@gmail.com>
Mon, 2 Nov 2015 03:25:27 +0000 (21:25 -0600)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 2 Nov 2015 04:02:06 +0000 (23:02 -0500)
This has been tested with the piglits in the mailing list and
on the Dolphin emulator.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
docs/GL3.txt
docs/relnotes/11.1.0.html
src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
src/mapi/glapi/gen/es_EXT.xml
src/mesa/main/extensions.c
src/mesa/vbo/vbo_exec_array.c

index 7964a5e0c402f2e1e540a7727a95a45503a25fd8..7f6b8c9ef27124d297af3ff19ac1a6c7208a89b8 100644 (file)
@@ -243,7 +243,7 @@ GLES3.2, GLSL ES 3.2
   GL_KHR_texture_compression_astc_ldr                  DONE (i965/gen9+)
   GL_OES_copy_image                                    not started (based on GL_ARB_copy_image, which is done for some drivers)
   GL_OES_draw_buffers_indexed                          not started
-  GL_OES_draw_elements_base_vertex                     not started (based on GL_ARB_draw_elements_base_vertex, which is done for all drivers)
+  GL_OES_draw_elements_base_vertex                     DONE (all drivers)
   GL_OES_geometry_shader                               not started (based on GL_ARB_geometry_shader4, which is done for all drivers)
   GL_OES_gpu_shader5                                   not started (based on parts of GL_ARB_gpu_shader5, which is done for some drivers)
   GL_OES_primitive_bounding box                        not started
index 972361fbdb660895eff2d1f55d9a20bf2a6d7a80..7160244fcb48ccc767258f6156e2f4b13459a780 100644 (file)
@@ -55,6 +55,8 @@ Note: some of the new features are only available with certain drivers.
 <li>GL_ARB_texture_barrier / GL_NV_texture_barrier on i965</li>
 <li>GL_ARB_texture_query_lod on softpipe</li>
 <li>GL_ARB_texture_view on radeonsi</li>
+<li>GL_EXT_draw_elements_base_vertex on all drivers</li>
+<li>GL_OES_draw_elements_base_vertex on all drivers</li>
 <li>EGL_KHR_create_context on softpipe, llvmpipe</li>
 <li>EGL_KHR_gl_colorspace on softpipe, llvmpipe</li>
 <li>new virgl gallium driver for qemu virtio-gpu</li>
index 120bda13dd8fb457bd55e9bdf846b8b00ac6fc37..72aa62c775184190c3c8e65da836df6e7fd99b32 100644 (file)
@@ -8,7 +8,7 @@
 
 <category name="GL_ARB_draw_elements_base_vertex" number="62">
 
-    <function name="DrawElementsBaseVertex" exec="dynamic">
+    <function name="DrawElementsBaseVertex" es2="3.2" exec="dynamic">
         <param name="mode" type="GLenum"/>
         <param name="count" type="GLsizei"/>
         <param name="type" type="GLenum"/>
@@ -16,7 +16,7 @@
         <param name="basevertex" type="GLint"/>
     </function>
 
-    <function name="DrawRangeElementsBaseVertex" exec="dynamic">
+    <function name="DrawRangeElementsBaseVertex" es2="3.2" exec="dynamic">
         <param name="mode" type="GLenum"/>
         <param name="start" type="GLuint"/>
         <param name="end" type="GLuint"/>
@@ -35,7 +35,7 @@
         <param name="basevertex" type="const GLint *"/>
     </function>
 
-    <function name="DrawElementsInstancedBaseVertex" exec="dynamic">
+    <function name="DrawElementsInstancedBaseVertex" es2="3.2" exec="dynamic">
         <param name="mode" type="GLenum"/>
         <param name="count" type="GLsizei"/>
         <param name="type" type="GLenum"/>
index cfca5a980bbafaa420589e05c551754fc62b0ebe..bf20e4801cc3ae5534a5397038b8c21158d4c1f9 100644 (file)
     </function>
 </category>
 
+<category name="GL_EXT_draw_elements_base_vertex" number="204">
+
+    <function name="DrawElementsBaseVertexEXT" alias="DrawElementsBaseVertex"
+              es2="2.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="count" type="GLsizei"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid *"/>
+        <param name="basevertex" type="GLint"/>
+    </function>
+
+    <function name="DrawRangeElementsBaseVertexEXT" alias="DrawRangeElementsBaseVertex"
+              es2="3.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="start" type="GLuint"/>
+        <param name="end" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid *"/>
+        <param name="basevertex" type="GLint"/>
+    </function>
+
+    <function name="MultiDrawElementsBaseVertexEXT" alias="MultiDrawElementsBaseVertex"
+              es2="2.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="count" type="const GLsizei *"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid * const *"/>
+        <param name="primcount" type="GLsizei"/>
+        <param name="basevertex" type="const GLint *"/>
+    </function>
+
+    <function name="DrawElementsInstancedBaseVertexEXT" alias="DrawElementsInstancedBaseVertex"
+              es2="3.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="count" type="GLsizei"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid *"/>
+        <param name="primcount" type="GLsizei"/>
+        <param name="basevertex" type="GLint"/>
+    </function>
+
+</category>
+
+<category name="GL_OES_draw_elements_base_vertex" number="219">
+
+    <function name="DrawElementsBaseVertexOES" alias="DrawElementsBaseVertex"
+              es2="2.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="count" type="GLsizei"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid *"/>
+        <param name="basevertex" type="GLint"/>
+    </function>
+
+    <function name="DrawRangeElementsBaseVertexOES" alias="DrawRangeElementsBaseVertex"
+              es2="3.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="start" type="GLuint"/>
+        <param name="end" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid *"/>
+        <param name="basevertex" type="GLint"/>
+    </function>
+
+    <function name="MultiDrawElementsBaseVertexOES" alias="MultiDrawElementsBaseVertex"
+              es2="2.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="count" type="const GLsizei *"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid * const *"/>
+        <param name="primcount" type="GLsizei"/>
+        <param name="basevertex" type="const GLint *"/>
+    </function>
+
+    <function name="DrawElementsInstancedBaseVertexOES" alias="DrawElementsInstancedBaseVertex"
+              es2="3.0" exec="dynamic">
+        <param name="mode" type="GLenum"/>
+        <param name="count" type="GLsizei"/>
+        <param name="type" type="GLenum"/>
+        <param name="indices" type="const GLvoid *"/>
+        <param name="primcount" type="GLsizei"/>
+        <param name="basevertex" type="GLint"/>
+    </function>
+
+</category>
+
 </OpenGLAPI>
index 64972fafa94b610c9081dcd87fb21c4ea9b793c4..d964f030ecb174cc8fd450f108b55c5bc53980b0 100644 (file)
@@ -230,6 +230,7 @@ static const struct extension extension_table[] = {
    { "GL_EXT_depth_bounds_test",                   o(EXT_depth_bounds_test),                   GL,             2002 },
    { "GL_EXT_draw_buffers",                        o(dummy_true),                                         ES2, 2012 },
    { "GL_EXT_draw_buffers2",                       o(EXT_draw_buffers2),                       GL,             2006 },
+   { "GL_EXT_draw_elements_base_vertex",           o(ARB_draw_elements_base_vertex),                      ES2, 2014 },
    { "GL_EXT_draw_instanced",                      o(ARB_draw_instanced),                      GL,             2006 },
    { "GL_EXT_draw_range_elements",                 o(dummy_true),                              GLL,            1997 },
    { "GL_EXT_fog_coord",                           o(dummy_true),                              GLL,            1999 },
@@ -306,6 +307,7 @@ static const struct extension extension_table[] = {
    { "GL_OES_depth32",                             o(dummy_false),                     DISABLE,                2005 },
    { "GL_OES_depth_texture",                       o(ARB_depth_texture),                                  ES2, 2006 },
    { "GL_OES_depth_texture_cube_map",              o(OES_depth_texture_cube_map),                         ES2, 2012 },
+   { "GL_OES_draw_elements_base_vertex",           o(ARB_draw_elements_base_vertex),                      ES2, 2014 },
    { "GL_OES_draw_texture",                        o(OES_draw_texture),                             ES1,       2004 },
    { "GL_OES_EGL_sync",                            o(dummy_true),                                   ES1 | ES2, 2010 },
    /*  FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL contexts. */
index 34d2c1d3d6ba3e330b8534ee3382d716b7299cb4..e27fdd9053281607b943bdbe629127352e0e5ccf 100644 (file)
@@ -1807,13 +1807,20 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,
       SET_EvalMesh2(exec, vbo_exec_EvalMesh2);
    }
 
-   if (_mesa_is_desktop_gl(ctx)) {
+   if (ctx->API != API_OPENGLES &&
+       ctx->Extensions.ARB_draw_elements_base_vertex) {
       SET_DrawElementsBaseVertex(exec, vbo_exec_DrawElementsBaseVertex);
-      SET_DrawRangeElementsBaseVertex(exec, vbo_exec_DrawRangeElementsBaseVertex);
       SET_MultiDrawElementsBaseVertex(exec, vbo_exec_MultiDrawElementsBaseVertex);
+
+      if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
+         SET_DrawRangeElementsBaseVertex(exec, vbo_exec_DrawRangeElementsBaseVertex);
+         SET_DrawElementsInstancedBaseVertex(exec, vbo_exec_DrawElementsInstancedBaseVertex);
+      }
+   }
+
+   if (_mesa_is_desktop_gl(ctx)) {
       SET_DrawArraysInstancedBaseInstance(exec, vbo_exec_DrawArraysInstancedBaseInstance);
       SET_DrawElementsInstancedBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseInstance);
-      SET_DrawElementsInstancedBaseVertex(exec, vbo_exec_DrawElementsInstancedBaseVertex);
       SET_DrawElementsInstancedBaseVertexBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseVertexBaseInstance);
    }