Mesa (main): iris: make iris_bind_reserve_3d and Wa_1604061319 only check for dirty render bindings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jul 4 07:35:56 UTC 2021


Module: Mesa
Branch: main
Commit: 4504fabed659d9085ce9c3aae590c5728e872b7e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4504fabed659d9085ce9c3aae590c5728e872b7e

Author: Dave Airlie <airlied at redhat.com>
Date:   Sat Jul  3 10:04:47 2021 +1000

iris: make iris_bind_reserve_3d and Wa_1604061319 only check for dirty render bindings

+    9.31%  drawover:gdrv0  iris_dri.so      [.] iris_binder_reserve_3d

+    2.36%  drawover:gdrv0  iris_dri.so         [.] iris_binder_reserve_3d

If the app never uses compute, then the compute bindings bit will always
be dirty causing these two paths never get shortcuts.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11699>

---

 src/gallium/drivers/iris/iris_binder.c  |  2 +-
 src/gallium/drivers/iris/iris_context.h | 12 +++++++-----
 src/gallium/drivers/iris/iris_state.c   |  2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_binder.c b/src/gallium/drivers/iris/iris_binder.c
index f41444e6009..1b6851786e9 100644
--- a/src/gallium/drivers/iris/iris_binder.c
+++ b/src/gallium/drivers/iris/iris_binder.c
@@ -144,7 +144,7 @@ iris_binder_reserve_3d(struct iris_context *ice)
 
    /* If nothing is dirty, skip all this. */
    if (!(ice->state.dirty & IRIS_DIRTY_RENDER_BUFFER) &&
-       !(ice->state.stage_dirty & IRIS_ALL_STAGE_DIRTY_BINDINGS))
+       !(ice->state.stage_dirty & IRIS_ALL_STAGE_DIRTY_BINDINGS_FOR_RENDER))
       return;
 
    /* Get the binding table sizes for each stage */
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 1e7d4e9a4fc..0f78e7d82fa 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -165,11 +165,13 @@ enum {
 
 #define IRIS_ALL_STAGE_DIRTY_FOR_RENDER (~IRIS_ALL_STAGE_DIRTY_FOR_COMPUTE)
 
-#define IRIS_ALL_STAGE_DIRTY_BINDINGS (IRIS_STAGE_DIRTY_BINDINGS_VS  | \
-                                       IRIS_STAGE_DIRTY_BINDINGS_TCS | \
-                                       IRIS_STAGE_DIRTY_BINDINGS_TES | \
-                                       IRIS_STAGE_DIRTY_BINDINGS_GS  | \
-                                       IRIS_STAGE_DIRTY_BINDINGS_FS  | \
+#define IRIS_ALL_STAGE_DIRTY_BINDINGS_FOR_RENDER (IRIS_STAGE_DIRTY_BINDINGS_VS  | \
+                                                  IRIS_STAGE_DIRTY_BINDINGS_TCS | \
+                                                  IRIS_STAGE_DIRTY_BINDINGS_TES | \
+                                                  IRIS_STAGE_DIRTY_BINDINGS_GS  | \
+                                                  IRIS_STAGE_DIRTY_BINDINGS_FS)
+
+#define IRIS_ALL_STAGE_DIRTY_BINDINGS (IRIS_ALL_STAGE_DIRTY_BINDINGS_FOR_RENDER | \
                                        IRIS_STAGE_DIRTY_BINDINGS_CS)
 
 /**
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index f520ac3438f..0d4c7650793 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -5763,7 +5763,7 @@ iris_upload_dirty_render_state(struct iris_context *ice,
     */
    const bool emit_const_wa = GFX_VER >= 11 &&
       ((dirty & IRIS_DIRTY_RENDER_BUFFER) ||
-       (stage_dirty & IRIS_ALL_STAGE_DIRTY_BINDINGS));
+       (stage_dirty & IRIS_ALL_STAGE_DIRTY_BINDINGS_FOR_RENDER));
 
 #if GFX_VER >= 12
    uint32_t nobuffer_stages = 0;



More information about the mesa-commit mailing list