Revert "freedreno: Account for multi-draw in num_draws"
authorRob Clark <robdclark@chromium.org>
Sun, 26 Feb 2023 21:39:32 +0000 (13:39 -0800)
committerMarge Bot <emma+marge@anholt.net>
Mon, 27 Feb 2023 18:30:09 +0000 (18:30 +0000)
autotune already divides draw-cost by # of draws, but only increments
the draw-cost once per multi-draw.  We could either _also_ account for
draw-cost by multiply by # of draws for treat multi-draw as a single
draw.  The latter saves an integer multiply per draw.

Fixes a performance regression triggered by transition from GMEM to
sysmem rendering.

This reverts commit 6bfee9e6697e286c82f36a15d0e8a7c1ec7d2a02.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21543>

src/gallium/drivers/freedreno/freedreno_draw.c

index 41c75bd..672dcc5 100644 (file)
@@ -364,7 +364,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
       assert(ctx->batch == batch);
    }
 
-   batch->num_draws += num_draws;
+   batch->num_draws++;
 
    /* Marking the batch as needing flush must come after the batch
     * dependency tracking (resource_read()/resource_write()), as that