glsl/nir: Add texture_buffers to shader info

While analyzing glsl shaders, keep a bitmask of texture buffers. This
information is needed by panfrost.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38490>
This commit is contained in:
Lars-Ivar Hesselberg Simonsen 2025-11-14 10:46:14 +01:00
parent cdaf6b5d5e
commit 46b44cf941
2 changed files with 11 additions and 0 deletions

View file

@ -247,6 +247,14 @@ record_textures_used(struct shader_info *info,
BITSET_SET_COUNT(info->textures_used_by_txf, var->data.binding,
MAX2(size, 1));
}
enum glsl_sampler_dim sampler_dim =
glsl_get_sampler_dim(glsl_without_array(var->type));
if (sampler_dim == GLSL_SAMPLER_DIM_BUF) {
BITSET_SET_RANGE(info->texture_buffers, var->data.binding,
var->data.binding + (MAX2(size, 1) - 1));
}
}
static void

View file

@ -138,6 +138,9 @@ typedef struct shader_info {
/** Bitfield of which textures are used by texelFetch() */
BITSET_DECLARE(textures_used_by_txf, 128);
/** Bitfield of which textures are texel buffers */
BITSET_DECLARE(texture_buffers, 128);
/** Bitfield of which samplers are used */
BITSET_DECLARE(samplers_used, 32);