st/mesa: fix comments, whitespace
[mesa.git] / src / mesa / state_tracker / st_cb_condrender.c
index 8483b93bd85630b50ea87681c7918c8b9d3b728b..64c6c117fca4efa71bff4a7720b2bda4f111c848 100644 (file)
  * Called via ctx->Driver.BeginConditionalRender()
  */
 static void
-st_BeginConditionalRender(GLcontext *ctx, struct gl_query_object *q,
+st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
                           GLenum mode)
 {
    struct st_query_object *stq = st_query_object(q);
-   struct pipe_context *pipe = ctx->st->pipe;
+   struct st_context *st = st_context(ctx);
+   struct pipe_context *pipe = st->pipe;
    uint m;
 
    switch (mode) {
@@ -72,6 +73,9 @@ st_BeginConditionalRender(GLcontext *ctx, struct gl_query_object *q,
       m = PIPE_RENDER_COND_WAIT;
    }
 
+   st->render_condition = stq->pq;
+   st->condition_mode = m;
+
    pipe->render_condition(pipe, stq->pq, m);
 }
 
@@ -80,11 +84,14 @@ st_BeginConditionalRender(GLcontext *ctx, struct gl_query_object *q,
  * Called via ctx->Driver.BeginConditionalRender()
  */
 static void
-st_EndConditionalRender(GLcontext *ctx, struct gl_query_object *q)
+st_EndConditionalRender(struct gl_context *ctx, struct gl_query_object *q)
 {
-   struct pipe_context *pipe = ctx->st->pipe;
+   struct st_context *st = st_context(ctx);
+   struct pipe_context *pipe = st->pipe;
    (void) q;
+
    pipe->render_condition(pipe, NULL, 0);
+   st->render_condition = NULL;
 }