summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-02-28 13:33:51 -0800
committerIan Romanick <ian.d.romanick@intel.com>2012-05-17 21:52:55 -0700
commitfe64ad0cba965a0334276560b291c9eba8c2ad25 (patch)
treea40939ad8e0dc53606d2205137ab04c86a4257c1
parentae02489a6dc173fec03277a84c6ef40f7c906103 (diff)
mesa: Fix display list handling for GL_ARB_draw_instanced.
When you called them in a display list compile before, you would just end up calling through NULL. Fixes piglit GL_ARB_draw_instanced/dlist. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 3c69a18b6a9f292542672c58bb324a69b750a208)
-rw-r--r--src/mesa/main/api_validate.c6
-rw-r--r--src/mesa/main/dlist.c28
2 files changed, 28 insertions, 6 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 2307456768..cb9db55d6b 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -399,12 +399,6 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
if (!check_valid_to_render(ctx, "glDrawArraysInstanced(invalid to render)"))
return GL_FALSE;
- if (ctx->CompileFlag) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glDrawArraysInstanced(display list");
- return GL_FALSE;
- }
-
if (ctx->Const.CheckArrayBounds) {
if (first + count > (GLint) ctx->Array.ArrayObj->_MaxElement)
return GL_FALSE;
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 677debffcb..0eefd40261 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1300,6 +1300,30 @@ save_BlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeA)
}
+/* GL_ARB_draw_instanced. */
+static void GLAPIENTRY
+save_DrawArraysInstancedARB(GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei primcount)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawArraysInstanced() during display list compile");
+}
+
+static void GLAPIENTRY
+save_DrawElementsInstancedARB(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLsizei primcount)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawElementsInstanced() during display list compile");
+}
+
static void invalidate_saved_current_state( struct gl_context *ctx )
{
GLint i;
@@ -10751,6 +10775,10 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
vfmt->Rectf = save_Rectf;
+ /* GL_ARB_draw_instanced */
+ vfmt->DrawArraysInstanced = save_DrawArraysInstancedARB;
+ vfmt->DrawElementsInstanced = save_DrawElementsInstancedARB;
+
/* 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