Mesa (main): pan/bi: Make bi_index padding explicit
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Nov 12 16:47:45 UTC 2021
Module: Mesa
Branch: main
Commit: 238f6d80a70b937890253507c5f1b3b9b5b494bc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=238f6d80a70b937890253507c5f1b3b9b5b494bc
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Fri Nov 12 11:11:25 2021 -0500
pan/bi: Make bi_index padding explicit
Avoids reliance on UB.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13723>
---
src/panfrost/bifrost/compiler.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index a734c60ea28..b3e8a4808cc 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -132,6 +132,9 @@ typedef struct {
uint32_t offset : 2;
bool reg : 1;
enum bi_index_type type : 3;
+
+ /* Must be zeroed so we can hash the whole 64-bits at a time */
+ unsigned padding : (32 - 13);
} bi_index;
static inline bi_index
More information about the mesa-commit
mailing list