From ffb5488c73d99449d4f83bcbdbf6644744d495de Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Fri, 8 Jan 2021 11:16:55 +1300 Subject: [PATCH] panfrost: Fix textureSize for buffer textures Suggested-by: Boris Brezillon Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 5a62265d9cf..a4b90332171 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -762,6 +762,14 @@ static void panfrost_upload_txs_sysval(struct panfrost_batch *batch, struct pipe_sampler_view *tex = &ctx->sampler_views[st][texidx]->base; assert(dim); + + if (tex->target == PIPE_BUFFER) { + assert(dim == 1); + uniform->i[0] = + tex->u.buf.size / util_format_get_blocksize(tex->format); + return; + } + uniform->i[0] = u_minify(tex->texture->width0, tex->u.tex.first_level); if (dim > 1)