Mesa (staging/21.2): nir: Initialize evaluate_cube_face_index_amd dst.x.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 13 22:06:01 UTC 2021


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

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Mon Aug  9 14:24:07 2021 -0700

nir: Initialize evaluate_cube_face_index_amd dst.x.

Fix defect reported by Coverity Scan.

Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value dst.x.

Fixes: a1a2a8dfda7 ("nir: add AMD_gcn_shader extended instructions")
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12290>
(cherry picked from commit 8d679f4f4e8d33402f11ab3da93ff815e4c44538)

---

 .pick_status.json               | 2 +-
 src/compiler/nir/nir_opcodes.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index ce468d20360..7349fad831b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -139,7 +139,7 @@
         "description": "nir: Initialize evaluate_cube_face_index_amd dst.x.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "a1a2a8dfda7b9cac7e36bf8853d984a6009fc27e"
     },
diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index 832b6215222..f9330c0af2c 100644
--- a/src/compiler/nir/nir_opcodes.py
+++ b/src/compiler/nir/nir_opcodes.py
@@ -537,6 +537,7 @@ dst.y = dst.y * (1.0f / ma) + 0.5f;
 """)
 
 unop_horiz("cube_face_index_amd", 1, tfloat32, 3, tfloat32, """
+dst.x = 0.0;
 float absX = fabsf(src0.x);
 float absY = fabsf(src0.y);
 float absZ = fabsf(src0.z);



More information about the mesa-commit mailing list