aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-04 18:21:16 -0600
committerBrian Paul <[email protected]>2010-04-04 19:05:38 -0600
commit3b7ac45162412a79c3cd4d4dbc16bd54db597608 (patch)
tree075f8a31dccf2c079ede72cf6fa80b9cb46cbd5a /src/mesa/main
parentcf3193ad1cd75b847c5d626def701a4bb012d080 (diff)
mesa: implement core Mesa support for GL_ARB_draw_instanced
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h5
-rw-r--r--src/mesa/main/vtxfmt.c2
-rw-r--r--src/mesa/main/vtxfmt_tmp.h21
3 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 7c02faaa535..4679be72f76 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1186,6 +1186,11 @@ typedef struct {
const GLvoid **indices,
GLsizei primcount,
const GLint *basevertex);
+ void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
+ GLsizei count, GLsizei primcount);
+ void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices,
+ GLsizei primcount);
/*@}*/
/**
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index 0dd3e5e52ee..ca352e88e6b 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -140,6 +140,8 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex);
SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex);
SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex);
+ SET_DrawArraysInstanced(tab, vfmt->DrawArraysInstanced);
+ SET_DrawElementsInstanced(tab, vfmt->DrawElementsInstanced);
/* GL_NV_vertex_program */
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);
diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h
index 037c4b1888b..9ec6ea49aa2 100644
--- a/src/mesa/main/vtxfmt_tmp.h
+++ b/src/mesa/main/vtxfmt_tmp.h
@@ -391,6 +391,25 @@ static void GLAPIENTRY TAG(MultiDrawElementsBaseVertex)( GLenum mode,
primcount, basevertex ));
}
+static void GLAPIENTRY
+TAG(DrawArraysInstanced)(GLenum mode, GLint first,
+ GLsizei count, GLsizei primcount)
+{
+ PRE_LOOPBACK( DrawArraysInstanced );
+ CALL_DrawArraysInstanced(GET_DISPATCH(), (mode, first, count, primcount));
+}
+
+static void GLAPIENTRY
+TAG(DrawElementsInstanced)(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices,
+ GLsizei primcount)
+{
+ PRE_LOOPBACK( DrawElementsInstanced );
+ CALL_DrawElementsInstanced(GET_DISPATCH(),
+ (mode, count, type, indices, primcount));
+}
+
+
static void GLAPIENTRY TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 )
{
PRE_LOOPBACK( EvalMesh1 );
@@ -574,6 +593,8 @@ static GLvertexformat TAG(vtxfmt) = {
TAG(DrawElementsBaseVertex),
TAG(DrawRangeElementsBaseVertex),
TAG(MultiDrawElementsBaseVertex),
+ TAG(DrawArraysInstanced),
+ TAG(DrawElementsInstanced),
TAG(EvalMesh1),
TAG(EvalMesh2)
};