v3d/compiler: remove num_samplers_used from shader key

This is only ever used by assertions.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34742>
This commit is contained in:
Ella Stanforth 2025-04-29 14:15:34 +01:00 committed by Marge Bot
parent 01d0ccd664
commit bb07364c54
5 changed files with 0 additions and 19 deletions

View file

@ -412,7 +412,6 @@ struct v3d_key {
uint8_t return_size;
} sampler[V3D_MAX_TEXTURE_SAMPLERS];
uint8_t num_samplers_used;
uint8_t ucp_enables;
bool is_last_geometry_stage;
bool robust_uniform_access;

View file

@ -238,7 +238,6 @@ v3d_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
* itself, we still need to add the sampler configuration
* parameter if the output is 32 bit
*/
assert(sampler_idx < c->key->num_samplers_used);
bool output_type_32_bit =
c->key->sampler[sampler_idx].return_size == 32;

View file

@ -601,7 +601,6 @@ lower_tex_packing_cb(const nir_tex_instr *tex, const void *data)
int sampler_index = nir_tex_instr_need_sampler(tex) ?
tex->sampler_index : tex->backend_flags;
assert(sampler_index < c->key->num_samplers_used);
return c->key->sampler[sampler_index].return_size == 16 ?
nir_lower_tex_packing_16 : nir_lower_tex_packing_none;
}

View file

@ -963,8 +963,6 @@ pipeline_populate_v3d_key(struct v3d_key *key,
struct v3dv_descriptor_map *sampler_map =
&p_stage->pipeline->shared_data->maps[p_stage->stage]->sampler_map;
key->num_samplers_used = sampler_map->num_desc;
assert(key->num_samplers_used <= V3D_MAX_TEXTURE_SAMPLERS);
for (uint32_t sampler_idx = 0; sampler_idx < sampler_map->num_desc;
sampler_idx++) {
key->sampler[sampler_idx].return_size =

View file

@ -576,7 +576,6 @@ v3d_setup_shared_key(struct v3d_context *v3d, struct v3d_key *key,
{
const struct v3d_device_info *devinfo = &v3d->screen->devinfo;
key->num_samplers_used = texstate->num_textures;
for (int i = 0; i < texstate->num_textures; i++) {
struct pipe_sampler_view *sampler = texstate->textures[i];
@ -594,19 +593,6 @@ v3d_setup_shared_precompile_key(struct v3d_uncompiled_shader *uncompiled,
{
nir_shader *s = uncompiled->base.ir.nir;
/* The shader may have gaps in the texture bindings, so figure out
* the largest binding in use and setup the number of textures and
* samplers from there instead of just the texture count from shader
* info.
*/
key->num_samplers_used = 0;
for (int i = V3D_MAX_TEXTURE_SAMPLERS - 1; i >= 0; i--) {
if (s->info.textures_used[0] & (1 << i)) {
key->num_samplers_used = i + 1;
break;
}
}
/* Note that below we access they key's texture and sampler fields
* using the same index. On OpenGL they are the same (they are
* combined)