asahi: Enable dirty tracking
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 24 Nov 2022 16:29:39 +0000 (11:29 -0500)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 11 Dec 2022 02:50:45 +0000 (21:50 -0500)
Whoops. drawoverhead test 1 score from 496 -> 2377.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>

src/gallium/drivers/asahi/agx_state.c

index 889b08b..e16fb71 100644 (file)
@@ -1960,11 +1960,14 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
    struct agx_context *ctx = agx_context(pctx);
    struct agx_batch *batch = agx_get_batch(ctx);
 
+#ifndef NDEBUG
+   if (unlikely(agx_device(pctx->screen)->debug & AGX_DBG_DIRTY))
+         agx_dirty_all(ctx);
+#endif
+
    if (agx_scissor_culls_everything(ctx))
           return;
 
-   agx_dirty_all(ctx);
-
    /* Dirty track the reduced prim: lines vs points vs triangles */
    enum pipe_prim_type reduced_prim = u_reduced_prim(info->mode);
    if (reduced_prim != batch->reduced_prim) ctx->dirty |= AGX_DIRTY_PRIM;