Module: Mesa
Branch: staging/23.2
Commit: 3ef7bd62a37f8de9eda3f7ad85aa2e66e4ba5686
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ef7bd62a37f8de9eda3f7ad85aa2e66e4ba5686

Author: Kenneth Graunke <[email protected]>
Date:   Mon Jul 17 23:26:39 2023 -0700

iris: Re-emit 3DSTATE_DS for each primitive (workaround 14019750404)

Some platforms require us to re-emit 3DSTATE_DS before every 3DPRIMITIVE
when tessellation is enabled.  See workaround 14019750404.

Cc: 23.2 <mesa-stable>

Reviewed-by: Ivan Briano <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24150>
(cherry picked from commit 283e3acd3ad7c3a1c4467211d56799e93b5496e0)

---

 .pick_status.json                     |  2 +-
 src/gallium/drivers/iris/iris_state.c | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 13c2b6428eb..776d91573da 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1194,7 +1194,7 @@
         "description": "iris: Re-emit 3DSTATE_DS for each primitive 
(workaround 14019750404)",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
diff --git a/src/gallium/drivers/iris/iris_state.c 
b/src/gallium/drivers/iris/iris_state.c
index 2445df96d1b..881a5345db7 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -6314,6 +6314,16 @@ iris_upload_dirty_render_state(struct iris_context *ice,
    struct iris_screen *screen = batch->screen;
    struct iris_border_color_pool *border_color_pool =
       iris_bufmgr_get_border_color_pool(screen->bufmgr);
+
+   /* Re-emit 3DSTATE_DS before any 3DPRIMITIVE when tessellation is on */
+   /* FIXME: WA framework doesn't know about 14019750404 yet.
+    * if (intel_needs_workaround(batch->screen->devinfo, 14019750404) &&
+    *     ice->shaders.prog[MESA_SHADER_TESS_EVAL])
+    */
+   if (batch->screen->devinfo->has_mesh_shading &&
+       ice->shaders.prog[MESA_SHADER_TESS_EVAL])
+      ice->state.stage_dirty |= IRIS_STAGE_DIRTY_TES;
+
    const uint64_t dirty = ice->state.dirty;
    const uint64_t stage_dirty = ice->state.stage_dirty;
 

Reply via email to