radeonsi: convert the framebuffer state to atom-based
[mesa.git] / src / gallium / drivers / radeonsi / si_hw_context.c
index 7e40255a6f253c56ac6580de6668f78bffe87b9e..21a683ff5f76023a40f7d263e9e02f1c2013e0cf 100644 (file)
@@ -81,7 +81,7 @@ void si_context_flush(struct si_context *ctx, unsigned flags)
 {
        struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs;
 
-       if (!cs->cdw)
+       if (cs->cdw == ctx->b.initial_gfx_cs_size)
                return;
 
        /* suspend queries */
@@ -176,7 +176,10 @@ void si_begin_new_cs(struct si_context *ctx)
                r600_resume_nontimer_queries(&ctx->b);
        }
 
+       ctx->framebuffer.atom.dirty = true;
        si_all_descriptors_begin_new_cs(ctx);
+
+       ctx->b.initial_gfx_cs_size = ctx->b.rings.gfx.cs->cdw;
 }
 
 #if SI_TRACE_CS