Module: Mesa
Branch: main
Commit: 439b0e86884eba55a4c25add9fe2763af1782b9f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=439b0e86884eba55a4c25add9fe2763af1782b9f

Author: Lionel Landwerlin <[email protected]>
Date:   Mon Oct 23 17:42:35 2023 +0300

intel/fs: fix dynamic interpolation mode selection

We can end up in situation where we are dispatched with a multisample
framebuffer but not at per-sample. In this case we would request the
at_sample value with the wrong message configuration.

Relying on the BRW_WM_MSAA_FLAG_MULTISAMPLE_FBO flag superseeds
BRW_WM_MSAA_FLAG_PERSAMPLE_DISPATCH.

Fixes piglit tests :

spec@arb_gpu_shader5@arb_gpu_shader5-interpolateatsample*

With Zink on Anv

Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: 68027bd38e ("intel/fs: implement dynamic interpolation mode for dynamic 
persample shaders")
Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25854>

---

 src/intel/compiler/brw_lower_logical_sends.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_lower_logical_sends.cpp 
b/src/intel/compiler/brw_lower_logical_sends.cpp
index c055da7e8bc..1e7d7668f98 100644
--- a/src/intel/compiler/brw_lower_logical_sends.cpp
+++ b/src/intel/compiler/brw_lower_logical_sends.cpp
@@ -2715,6 +2715,7 @@ lower_math_logical_send(const fs_builder &bld, fs_inst 
*inst)
 
 static void
 lower_interpolator_logical_send(const fs_builder &bld, fs_inst *inst,
+                                const struct brw_wm_prog_key *wm_prog_key,
                                 const struct brw_wm_prog_data *wm_prog_data)
 {
    const intel_device_info *devinfo = bld.shader->devinfo;
@@ -2747,7 +2748,7 @@ lower_interpolator_logical_send(const fs_builder &bld, 
fs_inst *inst,
 
    const bool dynamic_mode =
       inst->opcode == FS_OPCODE_INTERPOLATE_AT_SAMPLE &&
-      wm_prog_data->persample_dispatch == BRW_SOMETIMES;
+      wm_prog_key->multisample_fbo == BRW_SOMETIMES;
 
    fs_reg desc = inst->src[1];
    uint32_t desc_imm =
@@ -2799,7 +2800,7 @@ lower_interpolator_logical_send(const fs_builder &bld, 
fs_inst *inst,
       desc = ubld.vgrf(BRW_REGISTER_TYPE_UD);
 
       check_dynamic_msaa_flag(ubld, wm_prog_data,
-                              BRW_WM_MSAA_FLAG_PERSAMPLE_DISPATCH);
+                              BRW_WM_MSAA_FLAG_MULTISAMPLE_FBO);
       if (orig_desc.file == IMM) {
          /* Not using SEL here because we would generate an instruction with 2
           * immediate sources which is not supported by HW.
@@ -3185,6 +3186,7 @@ fs_visitor::lower_logical_sends()
       case FS_OPCODE_INTERPOLATE_AT_SHARED_OFFSET:
       case FS_OPCODE_INTERPOLATE_AT_PER_SLOT_OFFSET:
          lower_interpolator_logical_send(ibld, inst,
+                                         (const brw_wm_prog_key *)key,
                                          brw_wm_prog_data(prog_data));
          break;
 

Reply via email to