From ce16ca4635152db4c1af45888cb9c225e8d94f5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 18 Dec 2011 04:06:29 +0100 Subject: [PATCH] mesa: implement display list support for indexed query functions Acked-by: Ian Romanick --- src/mesa/main/dlist.c | 49 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index a827d132d97..4a7a9961453 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -472,6 +472,10 @@ typedef enum /* ARB_timer_query */ OPCODE_QUERY_COUNTER, + /* ARB_transform_feedback3 */ + OPCODE_BEGIN_QUERY_INDEXED, + OPCODE_END_QUERY_INDEXED, + /* The following three are meta instructions */ OPCODE_ERROR, /* raise compiled-in error */ OPCODE_CONTINUE, @@ -5338,7 +5342,6 @@ save_BeginQueryARB(GLenum target, GLuint id) } } - static void GLAPIENTRY save_EndQueryARB(GLenum target) { @@ -5354,7 +5357,6 @@ save_EndQueryARB(GLenum target) } } - static void GLAPIENTRY save_QueryCounter(GLuint id, GLenum target) { @@ -5371,6 +5373,39 @@ save_QueryCounter(GLuint id, GLenum target) } } +static void GLAPIENTRY +save_BeginQueryIndexed(GLenum target, GLuint index, GLuint id) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_INDEXED, 3); + if (n) { + n[1].e = target; + n[2].ui = index; + n[3].ui = id; + } + if (ctx->ExecuteFlag) { + CALL_BeginQueryIndexed(ctx->Exec, (target, index, id)); + } +} + +static void GLAPIENTRY +save_EndQueryIndexed(GLenum target, GLuint index) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_END_QUERY_INDEXED, 2); + if (n) { + n[1].e = target; + n[2].ui = index; + } + if (ctx->ExecuteFlag) { + CALL_EndQueryIndexed(ctx->Exec, (target, index)); + } +} + #endif /* FEATURE_queryobj */ @@ -8368,6 +8403,12 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_QUERY_COUNTER: CALL_QueryCounter(ctx->Exec, (n[1].ui, n[2].e)); break; + case OPCODE_BEGIN_QUERY_INDEXED: + CALL_BeginQueryIndexed(ctx->Exec, (n[1].e, n[2].ui, n[3].ui)); + break; + case OPCODE_END_QUERY_INDEXED: + CALL_EndQueryIndexed(ctx->Exec, (n[1].e, n[2].ui)); + break; #endif case OPCODE_DRAW_BUFFERS_ARB: { @@ -10461,6 +10502,10 @@ _mesa_create_save_table(void) SET_PauseTransformFeedback(table, save_PauseTransformFeedback); SET_ResumeTransformFeedback(table, save_ResumeTransformFeedback); SET_DrawTransformFeedback(table, save_DrawTransformFeedback); +#if FEATURE_queryobj + SET_BeginQueryIndexed(table, save_BeginQueryIndexed); + SET_EndQueryIndexed(table, save_EndQueryIndexed); +#endif #endif /* GL_ARB_instanced_arrays */ -- 2.30.2