intel/fs: Fix inferred_sync_pipe for F16TO32 opcodes
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 8 Mar 2023 10:29:06 +0000 (02:29 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 9 Mar 2023 23:26:17 +0000 (23:26 +0000)
For converting half-float to float, we currently emit BRW_OPCODE_F16TO32
with a UW source, to match legacy Gfx7 behavior.  In the generator, this
becomes a MOV with a HF source on Gfx8+.  Unfortunately, this UW source
confuses the scoreboarding pass into thinking it's an integer source,
leading to incorrect SWSB annotations on Alchemist.

We should ultimately fix the IR to stop being so...legacy...here, but
this is the simplest fix for stable branches.

Fixes misrendering in Elden Ring and likely Sekiro: Shadows Die Twice.

Cc: mesa-stable
Tested-by: Chuansheng Liu <chuansheng.liu@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8018
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8375
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>

src/intel/compiler/brw_fs_scoreboard.cpp

index 2418357..dd31b01 100644 (file)
@@ -84,7 +84,8 @@ namespace {
             if (inst->src[i].file != BAD_FILE &&
                 !inst->is_control_source(i)) {
                const brw_reg_type t = inst->src[i].type;
-               has_int_src |= !brw_reg_type_is_floating_point(t);
+               has_int_src |= !brw_reg_type_is_floating_point(t) &&
+                              inst->opcode != BRW_OPCODE_F16TO32;
                has_long_src |= type_sz(t) >= 8;
             }
          }