Mesa (staging/22.0): intel/fs: Initialize the sample mask in flags register when using demote

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 07:13:49 UTC 2022


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

Author: Caio Oliveira <caio.oliveira at intel.com>
Date:   Tue Mar 15 17:15:17 2022 -0700

intel/fs: Initialize the sample mask in flags register when using demote

Without this change, a check for "is helper invocation" could read
uninitialized values.

Fixes: 45f5db5a84a ("intel/fs: Implement "demote to helper invocation"")
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15400>
(cherry picked from commit bb311c22dfb7627111cf76cd2fb619c4c6fe8b79)

---

 .pick_status.json             | 2 +-
 src/intel/compiler/brw_fs.cpp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 59c42d2f199..d02b9e93262 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -8340,7 +8340,7 @@
         "description": "intel/fs: Initialize the sample mask in flags register when using demote",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 5,
+        "resolution": 1,
         "because_sha": "45f5db5a84ae6fe5d4a4d1cd8b62b48d70629fc9"
     },
     {
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index cb7713bfbb4..516b001620f 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -9652,7 +9652,8 @@ brw_nir_populate_wm_prog_data(const nir_shader *shader,
     * so the shader definitely kills pixels.
     */
    prog_data->uses_kill = shader->info.fs.uses_discard ||
-      key->emit_alpha_test;
+                          shader->info.fs.uses_demote ||
+                          key->emit_alpha_test;
    prog_data->uses_omask = !key->ignore_sample_mask_out &&
       (shader->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK));
    prog_data->computed_depth_mode = computed_depth_mode(shader);



More information about the mesa-commit mailing list