nir: Drop nir_tex_instr::texture_array_size

It's set by lots of things and we spend a lot of time maintaining it but
no one actually uses the value for anything useful.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3940>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3940>
This commit is contained in:
Jason Ekstrand 2020-02-24 21:16:01 -06:00 committed by Marge Bot
parent ec2f905ca8
commit 349898a967
11 changed files with 1 additions and 24 deletions

View File

@ -262,7 +262,6 @@ create_plane_tex_instr_implicit(struct ycbcr_state *state,
tex->component = old_tex->component;
tex->texture_index = old_tex->texture_index;
tex->texture_array_size = old_tex->texture_array_size;
tex->sampler_index = old_tex->sampler_index;
nir_ssa_dest_init(&tex->instr, &tex->dest,

View File

@ -548,7 +548,6 @@ nir_tex_instr_create(nir_shader *shader, unsigned num_srcs)
src_init(&instr->src[i].src);
instr->texture_index = 0;
instr->texture_array_size = 0;
instr->sampler_index = 0;
memcpy(instr->tg4_offsets, default_tg4_offsets, sizeof(instr->tg4_offsets));

View File

@ -1884,9 +1884,6 @@ typedef struct {
*/
unsigned texture_index;
/** The size of the texture array or 0 if it's not an array */
unsigned texture_array_size;
/** The sampler index
*
* The following operations do not require a sampler and, as such, this

View File

@ -419,7 +419,6 @@ clone_tex(clone_state *state, const nir_tex_instr *tex)
memcpy(ntex->tg4_offsets, tex->tg4_offsets, sizeof(tex->tg4_offsets));
ntex->texture_index = tex->texture_index;
ntex->texture_array_size = tex->texture_array_size;
ntex->sampler_index = tex->sampler_index;
ntex->texture_non_uniform = tex->texture_non_uniform;

View File

@ -274,7 +274,6 @@ hash_tex(uint32_t hash, const nir_tex_instr *instr)
for (unsigned j = 0; j < 2; ++j)
hash = HASH(hash, instr->tg4_offsets[i][j]);
hash = HASH(hash, instr->texture_index);
hash = HASH(hash, instr->texture_array_size);
hash = HASH(hash, instr->sampler_index);
hash = HASH(hash, instr->texture_non_uniform);
hash = HASH(hash, instr->sampler_non_uniform);
@ -659,7 +658,6 @@ nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)
tex1->is_new_style_shadow != tex2->is_new_style_shadow ||
tex1->component != tex2->component ||
tex1->texture_index != tex2->texture_index ||
tex1->texture_array_size != tex2->texture_array_size ||
tex1->sampler_index != tex2->sampler_index) {
return false;
}

View File

@ -83,8 +83,6 @@ lower_tex_src_to_offset(nir_builder *b,
src->src_type = is_sampler ?
nir_tex_src_sampler_offset :
nir_tex_src_texture_offset;
instr->texture_array_size = array_elements;
} else {
nir_tex_instr_remove_src(instr, src_idx);
}
@ -93,7 +91,6 @@ lower_tex_src_to_offset(nir_builder *b,
instr->sampler_index = base_index;
} else {
instr->texture_index = base_index;
instr->texture_array_size = array_elements;
}
}

View File

@ -672,8 +672,8 @@ union packed_instr {
unsigned instr_type:4;
unsigned num_srcs:4;
unsigned op:4;
unsigned texture_array_size:12;
unsigned dest:8;
unsigned _pad:12;
} tex;
struct {
unsigned instr_type:4;
@ -1460,7 +1460,6 @@ write_tex(write_ctx *ctx, const nir_tex_instr *tex)
{
assert(tex->num_srcs < 16);
assert(tex->op < 16);
assert(tex->texture_array_size < 1024);
union packed_instr header;
header.u32 = 0;
@ -1468,7 +1467,6 @@ write_tex(write_ctx *ctx, const nir_tex_instr *tex)
header.tex.instr_type = tex->instr.type;
header.tex.num_srcs = tex->num_srcs;
header.tex.op = tex->op;
header.tex.texture_array_size = tex->texture_array_size;
write_dest(ctx, &tex->dest, header, tex->instr.type);
@ -1508,7 +1506,6 @@ read_tex(read_ctx *ctx, union packed_instr header)
tex->op = header.tex.op;
tex->texture_index = blob_read_uint32(ctx->blob);
tex->texture_array_size = header.tex.texture_array_size;
tex->sampler_index = blob_read_uint32(ctx->blob);
if (tex->op == nir_texop_tg4)
blob_copy_bytes(ctx->blob, tex->tg4_offsets, sizeof(tex->tg4_offsets));

View File

@ -159,8 +159,6 @@ lower_tex_src_to_offset(nir_builder *b, nir_tex_instr *instr, unsigned src_idx,
src->src_type = is_sampler ?
nir_tex_src_sampler_offset :
nir_tex_src_texture_offset;
instr->texture_array_size = array_elements;
} else {
nir_tex_instr_remove_src(instr, src_idx);
}

View File

@ -1021,11 +1021,6 @@ lower_tex(nir_tex_instr *tex, struct apply_pipeline_layout_state *state)
lower_tex_deref(tex, nir_tex_src_sampler_deref,
&tex->sampler_index, plane, state);
/* The backend only ever uses this to mark used surfaces. We don't care
* about that little optimization so it just needs to be non-zero.
*/
tex->texture_array_size = 1;
}
static void

View File

@ -271,7 +271,6 @@ create_plane_tex_instr_implicit(struct ycbcr_state *state,
tex->component = old_tex->component;
tex->texture_index = old_tex->texture_index;
tex->texture_array_size = old_tex->texture_array_size;
tex->sampler_index = old_tex->sampler_index;
tex->is_array = old_tex->is_array;

View File

@ -1923,7 +1923,6 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
{
/* TODO */
//assert (!instr->sampler);
//assert (!instr->texture_array_size);
int texture_index = instr->texture_index;
int sampler_index = texture_index;