panfrost: Fix textureSize for buffer textures

Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8300>
This commit is contained in:
Icecream95 2021-01-08 11:16:55 +13:00 committed by Marge Bot
parent 388843526b
commit ffb5488c73
1 changed files with 8 additions and 0 deletions

View File

@ -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)