Mesa (main): panfrost: Add explicit padding to pan_blend_shader_key
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 23 21:08:49 UTC 2021
Module: Mesa
Branch: main
Commit: 6b7b8eb0468353ce09a3e305abdc26723d79d3f3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b7b8eb0468353ce09a3e305abdc26723d79d3f3
Author: Boris Brezillon <boris.brezillon at collabora.com>
Date: Fri Jun 4 14:41:06 2021 +0200
panfrost: Add explicit padding to pan_blend_shader_key
So the hash function doesn't end up hashing uninitialized values.
Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reported-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Fixes: bbff09b9521f ("panfrost: Move the blend shader cache at the device level")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11383>
---
src/panfrost/lib/pan_blend.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/panfrost/lib/pan_blend.h b/src/panfrost/lib/pan_blend.h
index cb5cdac9578..0b120a0a6b3 100644
--- a/src/panfrost/lib/pan_blend.h
+++ b/src/panfrost/lib/pan_blend.h
@@ -71,11 +71,12 @@ struct pan_blend_state {
struct pan_blend_shader_key {
enum pipe_format format;
nir_alu_type src0_type, src1_type;
- unsigned rt : 3;
- unsigned has_constants : 1;
- unsigned logicop_enable : 1;
- unsigned logicop_func:4;
- unsigned nr_samples : 5;
+ uint32_t rt : 3;
+ uint32_t has_constants : 1;
+ uint32_t logicop_enable : 1;
+ uint32_t logicop_func:4;
+ uint32_t nr_samples : 5;
+ uint32_t padding : 18;
struct pan_blend_equation equation;
};
More information about the mesa-commit
mailing list