[Mesa-dev] [PATCH] mesa: expose EXT_base_instance in ES3 contexts

Ilia Mirkin imirkin at alum.mit.edu
Sun Apr 3 06:45:29 UTC 2016


This extension is identical to ARB_base_instance. Reuse the same
entrypoints.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/mapi/glapi/gen/es_EXT.xml           | 34 +++++++++++++++++++++++++++++++++
 src/mesa/main/extensions_table.h        |  1 +
 src/mesa/main/tests/dispatch_sanity.cpp |  5 +++++
 src/mesa/vbo/vbo_exec_array.c           |  2 +-
 4 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 4989f32..f0eaa88 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -924,6 +924,40 @@
 
 </category>
 
+<category name="GL_EXT_base_instance" number="203">
+
+  <function name="DrawArraysInstancedBaseInstanceEXT" es2="3.0"
+            alias="DrawArraysInstancedBaseInstance">
+    <param name="mode" type="GLenum"/>
+    <param name="first" type="GLint"/>
+    <param name="count" type="GLsizei"/>
+    <param name="instancecount" type="GLsizei"/>
+    <param name="baseinstance" type="GLuint"/>
+  </function>
+
+  <function name="DrawElementsInstancedBaseInstanceEXT" es2="3.0"
+            alias="DrawElementsInstancedBaseInstance">
+    <param name="mode" type="GLenum"/>
+    <param name="count" type="GLsizei"/>
+    <param name="type" type="GLenum"/>
+    <param name="indices" type="const GLvoid *"/>
+    <param name="instancecount" type="GLsizei"/>
+    <param name="baseinstance" type="GLuint"/>
+  </function>
+
+  <function name="DrawElementsInstancedBaseVertexBaseInstanceEXT" es2="3.0"
+            alias="DrawElementsInstancedBaseVertexBaseInstance">
+    <param name="mode" type="GLenum"/>
+    <param name="count" type="GLsizei"/>
+    <param name="type" type="GLenum"/>
+    <param name="indices" type="const GLvoid *"/>
+    <param name="instancecount" type="GLsizei"/>
+    <param name="basevertex" type="GLint"/>
+    <param name="baseinstance" type="GLuint"/>
+  </function>
+
+</category>
+
 <category name="GL_EXT_draw_elements_base_vertex" number="204">
 
     <function name="DrawElementsBaseVertexEXT" alias="DrawElementsBaseVertex"
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 3ddaf40..6fc205b 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -177,6 +177,7 @@ EXT(ATI_texture_float                       , ARB_texture_float
 EXT(ATI_texture_mirror_once                 , ATI_texture_mirror_once                , GLL, GLC,  x ,  x , 2006)
 
 EXT(EXT_abgr                                , dummy_true                             , GLL, GLC,  x ,  x , 1995)
+EXT(EXT_base_instance                       , ARB_base_instance                      ,  x ,  x ,  x ,  30, 2014)
 EXT(EXT_bgra                                , dummy_true                             , GLL,  x ,  x ,  x , 1995)
 EXT(EXT_blend_color                         , EXT_blend_color                        , GLL,  x ,  x ,  x , 1995)
 EXT(EXT_blend_equation_separate             , EXT_blend_equation_separate            , GLL, GLC,  x ,  x , 2003)
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 1a49563..60a971a 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2482,6 +2482,11 @@ const struct function gles3_functions_possible[] = {
    { "glDisableiOES", 30, -1 },
    { "glIsEnablediOES", 30, -1 },
 
+   /* GL_EXT_base_instance */
+   { "glDrawArraysInstancedBaseInstanceEXT", 30, -1 },
+   { "glDrawElementsInstancedBaseInstanceEXT", 30, -1 },
+   { "glDrawElementsInstancedBaseVertexBaseInstanceEXT", 30, -1 },
+
    { NULL, 0, -1 }
 };
 
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index f0245fd..40cf3ff 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -1739,7 +1739,7 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,
       }
    }
 
-   if (_mesa_is_desktop_gl(ctx)) {
+   if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
       SET_DrawArraysInstancedBaseInstance(exec, vbo_exec_DrawArraysInstancedBaseInstance);
       SET_DrawElementsInstancedBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseInstance);
       SET_DrawElementsInstancedBaseVertexBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseVertexBaseInstance);
-- 
2.7.3



More information about the mesa-dev mailing list