diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h index 9c9aaeb88de..e4d3d297c36 100644 --- a/src/broadcom/compiler/v3d_compiler.h +++ b/src/broadcom/compiler/v3d_compiler.h @@ -408,14 +408,10 @@ static inline uint8_t v3d_slot_get_component(struct v3d_varying_slot slot) } struct v3d_key { - struct { - uint8_t swizzle[4]; - } tex[V3D_MAX_TEXTURE_SAMPLERS]; struct { uint8_t return_size; } sampler[V3D_MAX_TEXTURE_SAMPLERS]; - uint8_t num_tex_used; uint8_t num_samplers_used; uint8_t ucp_enables; bool is_last_geometry_stage; diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index b75af23203d..1fa68ea01de 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -740,20 +740,9 @@ v3d_lower_nir(struct v3d_compile *c) .lower_rect = false, /* XXX: Use this on V3D 3.x */ .lower_txp = ~0, - /* Apply swizzles to all samplers. */ - .swizzle_result = ~0, .lower_invalid_implicit_lod = true, }; - /* Lower the format swizzle and (for 32-bit returns) - * ARB_texture_swizzle-style swizzle. - */ - assert(c->key->num_tex_used <= ARRAY_SIZE(c->key->tex)); - for (int i = 0; i < c->key->num_tex_used; i++) { - for (int j = 0; j < 4; j++) - tex_options.swizzles[i][j] = c->key->tex[i].swizzle[j]; - } - tex_options.lower_tex_packing_cb = lower_tex_packing_cb; tex_options.lower_tex_packing_data = c; diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 022374eaed0..2c5f56c4f82 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -962,17 +962,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; - struct v3dv_descriptor_map *texture_map = - &p_stage->pipeline->shared_data->maps[p_stage->stage]->texture_map; - - key->num_tex_used = texture_map->num_desc; - assert(key->num_tex_used <= V3D_MAX_TEXTURE_SAMPLERS); - for (uint32_t tex_idx = 0; tex_idx < texture_map->num_desc; tex_idx++) { - key->tex[tex_idx].swizzle[0] = PIPE_SWIZZLE_X; - key->tex[tex_idx].swizzle[1] = PIPE_SWIZZLE_Y; - key->tex[tex_idx].swizzle[2] = PIPE_SWIZZLE_Z; - key->tex[tex_idx].swizzle[3] = PIPE_SWIZZLE_W; - } key->num_samplers_used = sampler_map->num_desc; assert(key->num_samplers_used <= V3D_MAX_TEXTURE_SAMPLERS); diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index c466baea0fa..b8dd4387c37 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -576,9 +576,7 @@ v3d_setup_shared_key(struct v3d_context *v3d, struct v3d_key *key, { const struct v3d_device_info *devinfo = &v3d->screen->devinfo; - key->num_tex_used = texstate->num_textures; key->num_samplers_used = texstate->num_textures; - assert(key->num_tex_used == key->num_samplers_used); for (int i = 0; i < texstate->num_textures; i++) { struct pipe_sampler_view *sampler = texstate->textures[i]; @@ -587,13 +585,6 @@ v3d_setup_shared_key(struct v3d_context *v3d, struct v3d_key *key, key->sampler[i].return_size = v3d_get_tex_return_size(devinfo, sampler->format); - - /* We let the sampler state handle the swizzle. - */ - key->tex[i].swizzle[0] = PIPE_SWIZZLE_X; - key->tex[i].swizzle[1] = PIPE_SWIZZLE_Y; - key->tex[i].swizzle[2] = PIPE_SWIZZLE_Z; - key->tex[i].swizzle[3] = PIPE_SWIZZLE_W; } } @@ -608,11 +599,9 @@ v3d_setup_shared_precompile_key(struct v3d_uncompiled_shader *uncompiled, * samplers from there instead of just the texture count from shader * info. */ - key->num_tex_used = 0; 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_tex_used = i + 1; key->num_samplers_used = i + 1; break; } @@ -624,11 +613,6 @@ v3d_setup_shared_precompile_key(struct v3d_uncompiled_shader *uncompiled, */ for (int i = 0; i < s->info.num_textures; i++) { key->sampler[i].return_size = 16; - - key->tex[i].swizzle[0] = PIPE_SWIZZLE_X; - key->tex[i].swizzle[1] = PIPE_SWIZZLE_Y; - key->tex[i].swizzle[2] = PIPE_SWIZZLE_Z; - key->tex[i].swizzle[3] = PIPE_SWIZZLE_W; } }