aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dlist.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-12-18 04:06:29 +0100
committerMarek Olšák <[email protected]>2012-07-12 13:05:59 +0200
commitce16ca4635152db4c1af45888cb9c225e8d94f5a (patch)
tree4245487b4ce6552c49ba9ddf53274d34bb6b7eae /src/mesa/main/dlist.c
parent553e13dbc2d5eff16f2c9a384ee5c5cf70b90901 (diff)
mesa: implement display list support for indexed query functions
Acked-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/dlist.c')
-rw-r--r--src/mesa/main/dlist.c49
1 files 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 */