mesa: fix glDrawRangeElementsBaseVertex should be compiled into display list
authorMarek Olšák <marek.olsak@amd.com>
Tue, 23 Aug 2022 18:57:56 +0000 (14:57 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Sep 2022 14:54:49 +0000 (14:54 +0000)
It's defined in terms of glDrawRangeElements, which is compiled into display
lists.

Cc: stable
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>

src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
src/mesa/main/glthread_draw.c
src/mesa/vbo/vbo_save_api.c

index 129582b..a7b1be1 100644 (file)
@@ -16,7 +16,7 @@
         <param name="basevertex" type="GLint"/>
     </function>
 
-    <function name="DrawRangeElementsBaseVertex" es2="3.2" marshal="custom">
+    <function name="DrawRangeElementsBaseVertex" es2="3.2" marshal="custom" exec="dlist">
         <param name="mode" type="GLenum"/>
         <param name="start" type="GLuint"/>
         <param name="end" type="GLuint"/>
index 21fce50..274db8b 100644 (file)
@@ -1198,7 +1198,7 @@ _mesa_marshal_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
                                           GLsizei count, GLenum type,
                                           const GLvoid *indices, GLint basevertex)
 {
-   draw_elements(mode, count, type, indices, 1, basevertex, 0, true, start, end, false);
+   draw_elements(mode, count, type, indices, 1, basevertex, 0, true, start, end, true);
 }
 
 void GLAPIENTRY
index 29c9c62..7d91488 100644 (file)
@@ -1874,6 +1874,21 @@ save_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
    save_DrawElements(mode, count, type, indices);
 }
 
+void GLAPIENTRY
+save_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
+                                 GLsizei count, GLenum type,
+                                 const GLvoid *indices, GLint basevertex)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (end < start) {
+      _mesa_compile_error(ctx, GL_INVALID_VALUE,
+                          "glDrawRangeElementsBaseVertex(end < start)");
+      return;
+   }
+
+   save_DrawElementsBaseVertex(mode, count, type, indices, basevertex);
+}
 
 void GLAPIENTRY
 save_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,