mesa/st: handle gl_Layer input semantic
[mesa.git] / src / mesa / state_tracker / st_cb_condrender.c
index b509d43b7c6975ce6b3be29b3925c6da31daf6f0..8776985f961277a4d24946f4fc0938f0aab1d2c8 100644 (file)
 
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
+#include "cso_cache/cso_context.h"
 #include "st_context.h"
 #include "st_cb_queryobj.h"
 #include "st_cb_condrender.h"
+#include "st_cb_bitmap.h"
 
 
 /**
  * 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 = st_context(ctx)->pipe;
+   struct st_context *st = st_context(ctx);
    uint m;
 
+   st_flush_bitmap_cache(st);
+
    switch (mode) {
    case GL_QUERY_WAIT:
       m = PIPE_RENDER_COND_WAIT;
@@ -72,19 +76,22 @@ st_BeginConditionalRender(GLcontext *ctx, struct gl_query_object *q,
       m = PIPE_RENDER_COND_WAIT;
    }
 
-   pipe->render_condition(pipe, stq->pq, m);
+   cso_set_render_condition(st->cso_context, stq->pq, FALSE, m);
 }
 
 
 /**
- * Called via ctx->Driver.BeginConditionalRender()
+ * Called via ctx->Driver.EndConditionalRender()
  */
 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 = st_context(ctx)->pipe;
+   struct st_context *st = st_context(ctx);
    (void) q;
-   pipe->render_condition(pipe, NULL, 0);
+
+   st_flush_bitmap_cache(st);
+
+   cso_set_render_condition(st->cso_context, NULL, FALSE, 0);
 }