From 6157ac47f5c7534e67eb6015834a8e2b621bcb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Thu, 22 Feb 2024 18:19:33 +0200 Subject: [PATCH] iris: make sure DS and TE are sent in pairs on >= gfx125 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have couple of dynamic fields used on >= gfx125, ScratchSpaceBuffer and TessellationDistributionMode. There are also 2 workarounds dealing with TessellationDistributionMode. These changes make sure that we always emit both DS and TE together when the dynamic fields need to be changed. This fixes KHR-Single-GL46.arrays_of_arrays_gl.AtomicUsage on MTL. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10636 Signed-off-by: Tapani Pälli Reviewed-by: José Roberto de Souza Reviewed-by: Lionel Landwerlin Part-of: (cherry picked from commit 1b1afd7b2412b142d140d482e0517aaf1778658f) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_state.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index fa2a67576c2..efdd5849fbd 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -734,7 +734,7 @@ "description": "iris: make sure DS and TE are sent in pairs on >= gfx125", "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 51bf69debef..8edc492b46f 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -7135,7 +7135,12 @@ iris_upload_dirty_render_state(struct iris_context *ice, } } +#if GFX_VERx10 >= 125 + /* This is only used on >= gfx125 for dynamic 3DSTATE_TE emission + * related workarounds. + */ bool program_needs_wa_14015055625 = false; +#endif #if INTEL_WA_14015055625_GFX_VER /* Check if FS stage will use primitive ID overrides for Wa_14015055625. */ @@ -7239,16 +7244,14 @@ iris_upload_dirty_render_state(struct iris_context *ice, GENX(3DSTATE_PS_length)); iris_emit_merge(batch, shader_psx, psx_state, GENX(3DSTATE_PS_EXTRA_length)); - } else if (stage == MESA_SHADER_TESS_EVAL && - intel_needs_workaround(batch->screen->devinfo, 14015055625) && - !program_needs_wa_14015055625) { - /* This program doesn't require Wa_14015055625, so we can enable - * a Tessellation Distribution Mode. - */ #if GFX_VERx10 >= 125 + } else if (stage == MESA_SHADER_TESS_EVAL) { uint32_t te_state[GENX(3DSTATE_TE_length)] = { 0 }; iris_pack_command(GENX(3DSTATE_TE), te_state, te) { - if (intel_needs_workaround(batch->screen->devinfo, 22012699309)) + if (intel_needs_workaround(screen->devinfo, 14015055625) && + program_needs_wa_14015055625) + te.TessellationDistributionMode = TEDMODE_OFF; + else if (intel_needs_workaround(screen->devinfo, 22012699309)) te.TessellationDistributionMode = TEDMODE_RR_STRICT; else te.TessellationDistributionMode = TEDMODE_RR_FREE;