From c74811897f33e8e076b1c76fad4b6119b0dd30e8 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 24 Mar 2026 14:24:07 -0400 Subject: [PATCH] pan/buffer: Add the offset to the size for buffer textures In the attribute model, the size is for the attribute binding and the offset is an offset into that range. If we're going to use that to offset the buffer itself, we need to increase the size accordingly. Fixes: a21ee564e205 ("pan/bi: Make texel buffers use Attribute Buffers") Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Christoph Pillmayer Reviewed-by: Lorenzo Rossi (cherry picked from commit ce56f495618cf32612e7aa00339427d0d5643468) Part-of: --- .pick_status.json | 2 +- src/panfrost/lib/pan_texture.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f28ebe5b462..7f539ba95f2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2064,7 +2064,7 @@ "description": "pan/buffer: Add the offset to the size for buffer textures", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "a21ee564e2051e5e6827ce333da1f85b8b828e1d", "notes": null diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c index 23a1585bbd4..e4c0988978d 100644 --- a/src/panfrost/lib/pan_texture.c +++ b/src/panfrost/lib/pan_texture.c @@ -1345,7 +1345,7 @@ GENX(pan_buffer_texture_emit)(const struct pan_buffer_view *bview, cfg.type = MALI_ATTRIBUTE_TYPE_1D; cfg.pointer = bview->base; cfg.stride = stride; - cfg.size = bview->width_el * stride; + cfg.size = bview->width_el * stride + bview->offset; } pan_pack(out_attrib, ATTRIBUTE, cfg) {