Module: Mesa Branch: staging/21.2 Commit: 13ae0c48e84abd63dcc97154965a14c0a9fc0bd7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=13ae0c48e84abd63dcc97154965a14c0a9fc0bd7
Author: Boris Brezillon <[email protected]> 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 <[email protected]> Reported-by: Tomeu Vizoso <[email protected]> Fixes: bbff09b9521f ("panfrost: Move the blend shader cache at the device level") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11383> (cherry picked from commit 6b7b8eb0468353ce09a3e305abdc26723d79d3f3) --- .pick_status.json | 2 +- src/panfrost/lib/pan_blend.h | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bfddd6fd48b..1db56ca574c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -391,7 +391,7 @@ "description": "panfrost: Add explicit padding to pan_blend_shader_key", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "bbff09b9521f17b40441885d06e089abf6c2e0b1" }, diff --git a/src/panfrost/lib/pan_blend.h b/src/panfrost/lib/pan_blend.h index 080130202c4..6a6233f4484 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; };
