freedreno: use bypass if only clears
authorRob Clark <robdclark@gmail.com>
Fri, 12 May 2017 18:24:33 +0000 (14:24 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 13 May 2017 17:12:36 +0000 (13:12 -0400)
Some things trigger batches that only contain a clear (like glmark2
startup).  No point to use GMEM for this.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_gmem.c

index d4b2e8d92fc0aa6abdf7707363f63b03567a3b19..310a0266c93646960c0dfe4fb5c71b76673ec02b 100644 (file)
@@ -390,7 +390,10 @@ fd_gmem_render_tiles(struct fd_batch *batch)
        bool sysmem = false;
 
        if (ctx->emit_sysmem_prep) {
-               if (batch->cleared || batch->gmem_reason || (batch->num_draws > 5)) {
+               if (batch->num_draws == 0) {
+                       sysmem = true;
+               } else if (batch->cleared || batch->gmem_reason || (batch->num_draws > 5)) {
+                       // TODO maybe consider # of draws w/ blend enabled, etc?
                        DBG("GMEM: cleared=%x, gmem_reason=%x, num_draws=%u",
                                batch->cleared, batch->gmem_reason, batch->num_draws);
                } else if (!(fd_mesa_debug & FD_DBG_NOBYPASS)) {