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

Author: Lionel Landwerlin <[email protected]>
Date:   Fri Aug 25 18:02:05 2023 +0300

intel/compiler: fix dynamic alpha-to-coverage handling

Got the wrong logic operation. Let's reuse the nicer NIR builder
helper.

Fixes a bunch of KHR-GL46.sample_variables.mask.rgba8.*.samples*.mask*

Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: fd7debc8bb ("intel/fs: make alpha_to_coverage a tristate")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9568
Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24716>
(cherry picked from commit 9bf2a89127f0f4ef3c98190b266c9346122eabe3)

---

 .pick_status.json                                    | 2 +-
 src/intel/compiler/brw_nir_lower_alpha_to_coverage.c | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 762ffeb77ea..5e3d033bd81 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2983,7 +2983,7 @@
         "description": "intel/compiler: fix dynamic alpha-to-coverage 
handling",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "fd7debc8bbb8f6a13f1f0e69c05d5000287a8e2f"
     },
diff --git a/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c 
b/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c
index 55020616fd5..a1d6e15bff0 100644
--- a/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c
+++ b/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c
@@ -180,9 +180,7 @@ brw_nir_lower_alpha_to_coverage(nir_shader *shader,
       nir_ssa_def *push_flags =
          nir_load_uniform(&b, 1, 32, nir_imm_int(&b, 
prog_data->msaa_flags_param * 4));
       nir_ssa_def *alpha_to_coverage =
-         nir_i2b(&b,
-                 nir_iadd_imm(&b, push_flags,
-                              BRW_WM_MSAA_FLAG_ALPHA_TO_COVERAGE));
+         nir_test_mask(&b, push_flags, BRW_WM_MSAA_FLAG_ALPHA_TO_COVERAGE);
       dither_mask = nir_bcsel(&b, alpha_to_coverage,
                               dither_mask, sample_mask_write->src[0].ssa);
    }

Reply via email to