gallium/radeon: simplify restoring render condition after flush
authorMarek Olšák <marek.olsak@amd.com>
Sat, 7 Nov 2015 14:00:55 +0000 (15:00 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 13 Nov 2015 18:54:42 +0000 (19:54 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/r600/r600_hw_context.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h

index 0fc58df157de2af21136b61b6544b9c46fecc593..f810b7150ea2dcea4545dd58a52c4992de500a87 100644 (file)
@@ -80,11 +80,6 @@ void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw,
                num_dw += ctx->b.streamout.num_dw_for_end;
        }
 
-       /* Count in render_condition(NULL) at the end of CS. */
-       if (ctx->b.predicate_drawing) {
-               num_dw += 3;
-       }
-
        /* SX_MISC */
        if (ctx->b.chip_class == R600) {
                num_dw += 3;
index 87399145be7cf54c6dfbc444cf6560a5d275375c..b6f6c92c5cff546641d3ecdfd4e75ae5d5903b94 100644 (file)
@@ -134,17 +134,6 @@ static void r600_memory_barrier(struct pipe_context *ctx, unsigned flags)
 
 void r600_preflush_suspend_features(struct r600_common_context *ctx)
 {
-       /* Disable render condition. */
-       ctx->saved_render_cond = NULL;
-       ctx->saved_render_cond_cond = FALSE;
-       ctx->saved_render_cond_mode = 0;
-       if (ctx->current_render_cond) {
-               ctx->saved_render_cond = ctx->current_render_cond;
-               ctx->saved_render_cond_cond = ctx->current_render_cond_cond;
-               ctx->saved_render_cond_mode = ctx->current_render_cond_mode;
-               ctx->b.render_condition(&ctx->b, NULL, FALSE, 0);
-       }
-
        /* suspend queries */
        ctx->queries_suspended_for_flush = false;
        if (ctx->num_cs_dw_nontimer_queries_suspend) {
@@ -173,12 +162,11 @@ void r600_postflush_resume_features(struct r600_common_context *ctx)
                r600_resume_timer_queries(ctx);
        }
 
-       /* Re-enable render condition. */
-       if (ctx->saved_render_cond) {
-               ctx->b.render_condition(&ctx->b, ctx->saved_render_cond,
-                                         ctx->saved_render_cond_cond,
-                                         ctx->saved_render_cond_mode);
-       }
+       /* Re-emit PKT3_SET_PREDICATION. */
+       if (ctx->current_render_cond)
+               ctx->b.render_condition(&ctx->b, ctx->current_render_cond,
+                                       ctx->current_render_cond_cond,
+                                       ctx->current_render_cond_mode);
 }
 
 static void r600_flush_from_st(struct pipe_context *ctx,
index 139c377cd6e58862becc95cff83b4209fa8e4ce5..2a3a3a707e311a12a2b1b6fbaeb898e3c3295948 100644 (file)
@@ -422,10 +422,6 @@ struct r600_common_context {
        boolean                         current_render_cond_cond;
        bool                            predicate_drawing;
        bool                            render_cond_force_off; /* for u_blitter */
-       /* For context flushing. */
-       struct pipe_query               *saved_render_cond;
-       boolean                         saved_render_cond_cond;
-       unsigned                        saved_render_cond_mode;
 
        /* MSAA sample locations.
         * The first index is the sample index.