mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 15:40:46 +02:00
v3d/compiler: remove unused texture swizzle
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34742>
This commit is contained in:
parent
76e27d2d0d
commit
01d0ccd664
4 changed files with 0 additions and 42 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue