panfrost: fix get_image_width for 1D buffer images
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Image size queries for buffer images were incorrectly using the
underlying buffer's width instead of the image view's size.

This affected `get_image_width` in OpenCL C for 1Dbuffer images, in
cases where the buffer is larger than the image to account for
padding, breaking the conformance test `test_kernel_image_methods
1Dbuffer`.

Fixes: 0efe7a6eb9 ("panfrost: implement image_size sysval")

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38949>
This commit is contained in:
Ahmed Hesham 2025-12-14 23:53:40 +00:00 committed by Marge Bot
parent d9834fcaa6
commit 95ed8d6638

View file

@ -1135,7 +1135,7 @@ panfrost_upload_image_size_sysval(struct panfrost_batch *batch,
if (image->resource->target == PIPE_BUFFER) {
unsigned blocksize = util_format_get_blocksize(image->format);
uniform->i[0] = image->resource->width0 / blocksize;
uniform->i[0] = image->u.buf.size / blocksize;
return;
}