panfrost: Fix blend leak for render targets 5-8
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Aug 2020 23:57:54 +0000 (19:57 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 20 Aug 2020 16:15:01 +0000 (18:15 +0200)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 375d4c2c74d ("panfrost: Extend blending to MRT")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>

src/gallium/drivers/panfrost/pan_blend_cso.c

index b39bfa89aac09c18aefc2f1f42987b8acb9a4d38..ffda1196d046dedbfc6fc4b23aeb4e62ead7d9c3 100644 (file)
@@ -165,7 +165,7 @@ panfrost_delete_blend_state(struct pipe_context *pipe,
 {
         struct panfrost_blend_state *blend = (struct panfrost_blend_state *) cso;
 
-        for (unsigned c = 0; c < 4; ++c) {
+        for (unsigned c = 0; c < PIPE_MAX_COLOR_BUFS; ++c) {
                 struct panfrost_blend_rt *rt = &blend->rt[c];
                 _mesa_hash_table_u64_clear(rt->shaders, panfrost_delete_blend_shader);
         }