From 1b1afd7b2412b142d140d482e0517aaf1778658f 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: --- src/gallium/drivers/iris/iris_state.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 3ab54c0b298..2539be2a0af 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -7150,7 +7150,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. */ @@ -7274,16 +7279,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;