Mesa (staging/21.2): iris: declare padding for iris_vue_prog_key

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 19 18:16:09 UTC 2021


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

Author: Mao, Marc <marc.mao at intel.com>
Date:   Wed Aug 18 07:56:58 2021 +0300

iris: declare padding for iris_vue_prog_key

Otherwise with some compilers/environments (Android) padding
may contain garbage and memcmp of the key will fail.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12438>
(cherry picked from commit fae1e99a15d12b82f65c77c90425335fec7562f1)

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/iris/iris_context.h | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index aee5fecadc1..546b523a52c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -130,7 +130,7 @@
         "description": "iris: declare padding for iris_vue_prog_key",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 0f78e7d82fa..3b54a6b680d 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -202,10 +202,15 @@ struct iris_base_prog_key {
    unsigned program_string_id;
 };
 
+/**
+ * Note, we need to take care to have padding explicitly declared
+ * for key since we will directly memcmp the whole struct.
+ */
 struct iris_vue_prog_key {
    struct iris_base_prog_key base;
 
    unsigned nr_userclip_plane_consts:4;
+   unsigned padding:28;
 };
 
 struct iris_vs_prog_key {



More information about the mesa-commit mailing list