summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h10
-rw-r--r--src/mesa/main/dlist.c45
-rw-r--r--src/mesa/main/extensions.c1
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/vtxfmt.c3
5 files changed, 60 insertions, 0 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 1582a8c81ec..5bcf36bfa71 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1029,12 +1029,22 @@ typedef struct {
const GLint *basevertex);
void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
GLsizei count, GLsizei primcount);
+ void (GLAPIENTRYP DrawArraysInstancedBaseInstance)(GLenum mode, GLint first,
+ GLsizei count, GLsizei primcount,
+ GLuint baseinstance);
void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
GLenum type, const GLvoid *indices,
GLsizei primcount);
+ void (GLAPIENTRYP DrawElementsInstancedBaseInstance)(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices,
+ GLsizei primcount, GLuint baseinstance);
void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count,
GLenum type, const GLvoid *indices,
GLsizei primcount, GLint basevertex);
+ void (GLAPIENTRYP DrawElementsInstancedBaseVertexBaseInstance)(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices,
+ GLsizei primcount, GLint basevertex,
+ GLuint baseinstance);
void (GLAPIENTRYP DrawTransformFeedback)(GLenum mode, GLuint name);
/*@}*/
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index e04f7ae6bbe..a0d84cfdc55 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1337,6 +1337,46 @@ save_DrawElementsInstancedBaseVertexARB(GLenum mode,
"glDrawElementsInstancedBaseVertex() during display list compile");
}
+/* GL_ARB_base_instance. */
+static void GLAPIENTRY
+save_DrawArraysInstancedBaseInstance(GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei primcount,
+ GLuint baseinstance)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawArraysInstancedBaseInstance() during display list compile");
+}
+
+static void APIENTRY
+save_DrawElementsInstancedBaseInstance(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const void *indices,
+ GLsizei primcount,
+ GLuint baseinstance)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawElementsInstancedBaseInstance() during display list compile");
+}
+
+static void APIENTRY
+save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const void *indices,
+ GLsizei primcount,
+ GLint basevertex,
+ GLuint baseinstance)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
+}
+
static void invalidate_saved_current_state( struct gl_context *ctx )
{
GLint i;
@@ -10816,6 +10856,11 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
/* GL_ARB_draw_elements_base_vertex */
vfmt->DrawElementsInstancedBaseVertex = save_DrawElementsInstancedBaseVertexARB;
+ /* GL_ARB_base_instance */
+ vfmt->DrawArraysInstancedBaseInstance = save_DrawArraysInstancedBaseInstance;
+ vfmt->DrawElementsInstancedBaseInstance = save_DrawElementsInstancedBaseInstance;
+ vfmt->DrawElementsInstancedBaseVertexBaseInstance = save_DrawElementsInstancedBaseVertexBaseInstance;
+
/* The driver is required to implement these as
* 1) They can probably do a better job.
* 2) A lot of new mechanisms would have to be added to this module
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 0e8178397d9..07931614500 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -78,6 +78,7 @@ struct extension {
static const struct extension extension_table[] = {
/* ARB Extensions */
{ "GL_ARB_ES2_compatibility", o(ARB_ES2_compatibility), GL, 2009 },
+ { "GL_ARB_base_instance", o(ARB_base_instance), GL, 2011 },
{ "GL_ARB_blend_func_extended", o(ARB_blend_func_extended), GL, 2009 },
{ "GL_ARB_color_buffer_float", o(ARB_color_buffer_float), GL, 2004 },
{ "GL_ARB_copy_buffer", o(ARB_copy_buffer), GL, 2008 },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 3d18b7c4869..d52ab151aa4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2869,6 +2869,7 @@ struct gl_extensions
GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */
GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */
GLboolean ARB_ES2_compatibility;
+ GLboolean ARB_base_instance;
GLboolean ARB_blend_func_extended;
GLboolean ARB_color_buffer_float;
GLboolean ARB_conservative_depth;
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index 6fb016b9edf..a27596a9864 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -105,8 +105,11 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex);
SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex);
SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced);
+ SET_DrawArraysInstancedBaseInstance(tab, vfmt->DrawArraysInstancedBaseInstance);
SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced);
+ SET_DrawElementsInstancedBaseInstance(tab, vfmt->DrawElementsInstancedBaseInstance);
SET_DrawElementsInstancedBaseVertex(tab, vfmt->DrawElementsInstancedBaseVertex);
+ SET_DrawElementsInstancedBaseVertexBaseInstance(tab, vfmt->DrawElementsInstancedBaseVertexBaseInstance);
SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback);
/* GL_NV_vertex_program */