From f1a64582ddb9d35387ae0becd7f60663d6d3de8b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 25 Feb 2026 10:07:49 -0500 Subject: [PATCH] st/bitmap: only release YUV samplerviews MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is consistent with other callers of st_get_sampler_views() and avoids desync in the sv cache Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14934 Fixes: 73da0dcddcb ("gallium: eliminate frontend refcounting from samplerviews") Acked-by: Marek Olšák (cherry picked from commit 1a5c660ef5b881d4193566a777b150ef912a4f9a) Part-of: --- .pick_status.json | 2 +- src/mesa/state_tracker/st_cb_bitmap.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f0285b8ffe7..9d8ee416191 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6124,7 +6124,7 @@ "description": "st/bitmap: only release YUV samplerviews", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "73da0dcddcb351f46544b207de55a4cb81654cb8", "notes": null diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index ed7f94b4f63..a05dc6369cf 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -255,8 +255,8 @@ setup_render_state(struct gl_context *ctx, pipe->set_sampler_views(pipe, MESA_SHADER_FRAGMENT, 0, num_views, 0, sampler_views); st->state.num_sampler_views[MESA_SHADER_FRAGMENT] = num_views; - - for (unsigned i = 0; i < num_views; i++) + /* only free YUV samplerviews */ + u_foreach_bit(i, extra_sampler_views) pipe->sampler_view_release(pipe, sampler_views[i]); }