Module: Mesa
Branch: staging/23.3
Commit: ead6751f58c016f53fbb2793fe69b9e3e53a4dbb
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ead6751f58c016f53fbb2793fe69b9e3e53a4dbb

Author: Tapani Pälli <[email protected]>
Date:   Fri Dec 15 10:15:32 2023 +0200

iris: use intel_needs_workaround with 14015055625

This was missing from the FS stage primitive-id check. Also add usage
of macro to avoid running any extra code on platforms where this WA
would not apply.

Fixes: 0f147240398 ("iris: Implement Wa_14015297576")
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: José Roberto de Souza <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26709>
(cherry picked from commit 82553774e2d1c3edff4c8e8683808d159846f83d)

---

 .pick_status.json                     | 2 +-
 src/gallium/drivers/iris/iris_state.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 2f529e90646..5be7afcb4ec 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -964,7 +964,7 @@
         "description": "iris: use intel_needs_workaround with 14015055625",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "0f147240398a5e9d424e507d9cd271802a340114",
         "notes": null
diff --git a/src/gallium/drivers/iris/iris_state.c 
b/src/gallium/drivers/iris/iris_state.c
index b7c194ab96e..33301e548c8 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -6806,13 +6806,16 @@ iris_upload_dirty_render_state(struct iris_context *ice,
 
    bool program_needs_wa_14015055625 = false;
 
+#if INTEL_WA_14015055625_GFX_VER
    /* Check if FS stage will use primitive ID overrides for Wa_14015055625. */
    const struct brw_vue_map *last_vue_map =
       &brw_vue_prog_data(ice->shaders.last_vue_shader->prog_data)->vue_map;
    if ((wm_prog_data->inputs & VARYING_BIT_PRIMITIVE_ID) &&
-       last_vue_map->varying_to_slot[VARYING_SLOT_PRIMITIVE_ID] == -1) {
+       last_vue_map->varying_to_slot[VARYING_SLOT_PRIMITIVE_ID] == -1 &&
+       intel_needs_workaround(batch->screen->devinfo, 14015055625)) {
       program_needs_wa_14015055625 = true;
    }
+#endif
 
    for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) {
       if (!(stage_dirty & (IRIS_STAGE_DIRTY_VS << stage)))
@@ -6828,8 +6831,10 @@ iris_upload_dirty_render_state(struct iris_context *ice,
          uint32_t scratch_addr =
             pin_scratch_space(ice, batch, prog_data, stage);
 
+#if INTEL_WA_14015055625_GFX_VER
          shader_program_needs_wa_14015055625(ice, batch, prog_data, stage,
                                              &program_needs_wa_14015055625);
+#endif
 
          if (stage == MESA_SHADER_FRAGMENT) {
             UNUSED struct iris_rasterizer_state *cso = ice->state.cso_rast;

Reply via email to