diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h index e4d3d297c36..f1a43b61dc2 100644 --- a/src/broadcom/compiler/v3d_compiler.h +++ b/src/broadcom/compiler/v3d_compiler.h @@ -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; diff --git a/src/broadcom/compiler/v3d_tex.c b/src/broadcom/compiler/v3d_tex.c index 52035d23318..edebb3e064f 100644 --- a/src/broadcom/compiler/v3d_tex.c +++ b/src/broadcom/compiler/v3d_tex.c @@ -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; diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index 1fa68ea01de..d849bc27cc3 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -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; } diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 2c5f56c4f82..0cf4be321ed 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -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 = diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index b8dd4387c37..06a858246bb 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -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)