agx: Stop passing nir_dest around
Towards deleting nir_dest. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
This commit is contained in:

committed by
Marge Bot

parent
7cf9ff304e
commit
6f66f3583e
@@ -798,10 +798,10 @@ agx_txf_sampler(agx_context *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
agx_expand_tex_to(agx_builder *b, nir_dest *dest, agx_index src, bool masked)
|
agx_expand_tex_to(agx_builder *b, nir_def *def, agx_index src, bool masked)
|
||||||
{
|
{
|
||||||
unsigned nr_channels = nir_dest_num_components(*dest);
|
unsigned nr_channels = def->num_components;
|
||||||
nir_component_mask_t mask = nir_def_components_read(&dest->ssa);
|
nir_component_mask_t mask = nir_def_components_read(def);
|
||||||
|
|
||||||
if (!masked)
|
if (!masked)
|
||||||
mask = (nir_component_mask_t)BITFIELD_MASK(nr_channels);
|
mask = (nir_component_mask_t)BITFIELD_MASK(nr_channels);
|
||||||
@@ -819,7 +819,7 @@ agx_expand_tex_to(agx_builder *b, nir_dest *dest, agx_index src, bool masked)
|
|||||||
: agx_undef(src.size);
|
: agx_undef(src.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
agx_emit_collect_to(b, agx_dest_index(dest), nr_channels, unpacked_channels);
|
agx_emit_collect_to(b, agx_def_index(def), nr_channels, unpacked_channels);
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -875,7 +875,7 @@ agx_emit_image_load(agx_builder *b, agx_index dst, nir_intrinsic_instr *intr)
|
|||||||
agx_instr *I = agx_image_load_to(
|
agx_instr *I = agx_image_load_to(
|
||||||
b, tmp, coords, lod, bindless, texture, agx_txf_sampler(b->shader),
|
b, tmp, coords, lod, bindless, texture, agx_txf_sampler(b->shader),
|
||||||
agx_null(), agx_tex_dim(dim, is_array), lod_mode, 0, 0, false);
|
agx_null(), agx_tex_dim(dim, is_array), lod_mode, 0, 0, false);
|
||||||
I->mask = agx_expand_tex_to(b, &intr->dest, tmp, true);
|
I->mask = agx_expand_tex_to(b, &intr->dest.ssa, tmp, true);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -937,7 +937,7 @@ static agx_instr *
|
|||||||
agx_emit_intrinsic(agx_builder *b, nir_intrinsic_instr *instr)
|
agx_emit_intrinsic(agx_builder *b, nir_intrinsic_instr *instr)
|
||||||
{
|
{
|
||||||
agx_index dst = nir_intrinsic_infos[instr->intrinsic].has_dest
|
agx_index dst = nir_intrinsic_infos[instr->intrinsic].has_dest
|
||||||
? agx_dest_index(&instr->dest)
|
? agx_def_index(&instr->dest.ssa)
|
||||||
: agx_null();
|
: agx_null();
|
||||||
gl_shader_stage stage = b->shader->stage;
|
gl_shader_stage stage = b->shader->stage;
|
||||||
|
|
||||||
@@ -1236,7 +1236,7 @@ agx_emit_alu(agx_builder *b, nir_alu_instr *instr)
|
|||||||
sz == 8) ||
|
sz == 8) ||
|
||||||
sz == 16 || sz == 32 || sz == 64);
|
sz == 16 || sz == 32 || sz == 64);
|
||||||
|
|
||||||
agx_index dst = agx_dest_index(&instr->dest.dest);
|
agx_index dst = agx_def_index(&instr->dest.dest.ssa);
|
||||||
agx_index s0 = srcs > 0 ? agx_alu_src_index(b, instr->src[0]) : agx_null();
|
agx_index s0 = srcs > 0 ? agx_alu_src_index(b, instr->src[0]) : agx_null();
|
||||||
agx_index s1 = srcs > 1 ? agx_alu_src_index(b, instr->src[1]) : agx_null();
|
agx_index s1 = srcs > 1 ? agx_alu_src_index(b, instr->src[1]) : agx_null();
|
||||||
agx_index s2 = srcs > 2 ? agx_alu_src_index(b, instr->src[2]) : agx_null();
|
agx_index s2 = srcs > 2 ? agx_alu_src_index(b, instr->src[2]) : agx_null();
|
||||||
@@ -1664,7 +1664,7 @@ agx_emit_tex(agx_builder *b, nir_tex_instr *instr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
agx_index dst = agx_dest_index(&instr->dest);
|
agx_index dst = agx_def_index(&instr->dest.ssa);
|
||||||
|
|
||||||
/* Pack shadow reference value (compare) and packed offset together */
|
/* Pack shadow reference value (compare) and packed offset together */
|
||||||
agx_index compare_offset = agx_null();
|
agx_index compare_offset = agx_null();
|
||||||
@@ -1691,7 +1691,7 @@ agx_emit_tex(agx_builder *b, nir_tex_instr *instr)
|
|||||||
* textureGatherOffsets. Don't try to mask the destination for gathers.
|
* textureGatherOffsets. Don't try to mask the destination for gathers.
|
||||||
*/
|
*/
|
||||||
bool masked = (instr->op != nir_texop_tg4);
|
bool masked = (instr->op != nir_texop_tg4);
|
||||||
I->mask = agx_expand_tex_to(b, &instr->dest, tmp, masked);
|
I->mask = agx_expand_tex_to(b, &instr->dest.ssa, tmp, masked);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1755,7 +1755,7 @@ agx_emit_jump(agx_builder *b, nir_jump_instr *instr)
|
|||||||
static void
|
static void
|
||||||
agx_emit_phi(agx_builder *b, nir_phi_instr *instr)
|
agx_emit_phi(agx_builder *b, nir_phi_instr *instr)
|
||||||
{
|
{
|
||||||
agx_instr *I = agx_phi_to(b, agx_dest_index(&instr->dest),
|
agx_instr *I = agx_phi_to(b, agx_def_index(&instr->dest.ssa),
|
||||||
exec_list_length(&instr->srcs));
|
exec_list_length(&instr->srcs));
|
||||||
|
|
||||||
/* Deferred */
|
/* Deferred */
|
||||||
|
@@ -466,21 +466,21 @@ agx_src_index(nir_src *src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline agx_index
|
static inline agx_index
|
||||||
agx_dest_index(nir_dest *dst)
|
agx_def_index(nir_def *def)
|
||||||
{
|
{
|
||||||
return agx_nir_ssa_index(&dst->ssa);
|
return agx_nir_ssa_index(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline agx_index
|
static inline agx_index
|
||||||
agx_vec_for_dest(agx_context *ctx, nir_dest *dest)
|
agx_vec_for_def(agx_context *ctx, nir_def *def)
|
||||||
{
|
{
|
||||||
return agx_temp(ctx, agx_size_for_bits(nir_dest_bit_size(*dest)));
|
return agx_temp(ctx, agx_size_for_bits(def->bit_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline agx_index
|
static inline agx_index
|
||||||
agx_vec_for_intr(agx_context *ctx, nir_intrinsic_instr *instr)
|
agx_vec_for_intr(agx_context *ctx, nir_intrinsic_instr *instr)
|
||||||
{
|
{
|
||||||
return agx_vec_for_dest(ctx, &instr->dest);
|
return agx_vec_for_def(ctx, &instr->dest.ssa);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned
|
static inline unsigned
|
||||||
|
Reference in New Issue
Block a user