nir: Rename stat_query_address_agx to stat_query_address_poly

This is used by the geometry lowering that we are going to move to
common code.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37914>
This commit is contained in:
Mary Guillemard 2025-10-05 23:34:47 +02:00 committed by Marge Bot
parent 8a25b88d69
commit 1e0c18d6cf
6 changed files with 14 additions and 13 deletions

View file

@ -946,12 +946,13 @@ agx_nir_create_pre_gs(struct agx_xfb_key *key)
nir_imm_ivec4(b, key->static_count[0], key->static_count[1],
key->static_count[2], key->static_count[3]),
nir_imm_int(b, key->invocations), nir_imm_int(b, key->vertices_per_prim),
nir_load_stat_query_address_agx(b,
.base = PIPE_STAT_QUERY_GS_INVOCATIONS),
nir_load_stat_query_address_agx(b, .base = PIPE_STAT_QUERY_GS_PRIMITIVES),
nir_load_stat_query_address_agx(b, .base = PIPE_STAT_QUERY_C_PRIMITIVES),
nir_load_stat_query_address_agx(b,
.base = PIPE_STAT_QUERY_C_INVOCATIONS));
nir_load_stat_query_address_poly(b,
.base = PIPE_STAT_QUERY_GS_INVOCATIONS),
nir_load_stat_query_address_poly(b,
.base = PIPE_STAT_QUERY_GS_PRIMITIVES),
nir_load_stat_query_address_poly(b, .base = PIPE_STAT_QUERY_C_PRIMITIVES),
nir_load_stat_query_address_poly(b,
.base = PIPE_STAT_QUERY_C_INVOCATIONS));
agx_preprocess_nir(b->shader);
return b->shader;
}

View file

@ -706,7 +706,7 @@ agx_nir_lower_stats_fs(nir_shader *s)
nir_def *samples = nir_bit_count(b, nir_load_sample_mask_in(b));
unsigned query = PIPE_STAT_QUERY_PS_INVOCATIONS;
nir_def *addr = nir_load_stat_query_address_agx(b, .base = query);
nir_def *addr = nir_load_stat_query_address_poly(b, .base = query);
nir_global_atomic(b, 32, addr, samples, .atomic_op = nir_atomic_op_iadd);
nir_pop_if(b, NULL);

View file

@ -478,7 +478,7 @@ lower_uvs_index(nir_builder *b, nir_intrinsic_instr *intrin, void *data)
return true;
}
case nir_intrinsic_load_stat_query_address_agx: {
case nir_intrinsic_load_stat_query_address_poly: {
b->cursor = nir_instr_remove(&intrin->instr);
unsigned off1 = hk_root_descriptor_offset(draw.pipeline_stats);

View file

@ -1426,6 +1426,9 @@ system_value("geometry_param_buffer_poly", 1, bit_sizes=[64])
# Address of the parameter buffer for poly tessellation shaders
system_value("tess_param_buffer_poly", 1, bit_sizes=[64])
# Address of the pipeline statistic query result indexed by BASE
system_value("stat_query_address_poly", 1, bit_sizes=[64], indices=[BASE])
# IR3-specific version of most SSBO intrinsics. The only different
# compare to the originals is that they add an extra source to hold
# the dword-offset, which is needed by the backend code apart from
@ -2327,9 +2330,6 @@ barrier("fence_pbe_to_tex_pixel_agx")
# Unknown fence used in the helper program on exit.
barrier("fence_helper_exit_agx")
# Address of the pipeline statistic query result indexed by BASE
system_value("stat_query_address_agx", 1, bit_sizes=[64], indices=[BASE])
# Helper shader intrinsics
# src[] = { value }.
intrinsic("doorbell_agx", src_comp=[1])

View file

@ -166,7 +166,7 @@ lower_intrinsic(nir_builder *b, nir_intrinsic_instr *intr,
return load_sysval_root(b, 1, 16, &u->sample_mask);
case nir_intrinsic_load_sample_positions_agx:
return load_sysval_root(b, 1, 32, &u->ppp_multisamplectl);
case nir_intrinsic_load_stat_query_address_agx:
case nir_intrinsic_load_stat_query_address_poly:
return load_sysval_root(
b, 1, 64, &u->pipeline_statistics[nir_intrinsic_base(intr)]);
case nir_intrinsic_load_ssbo_address:

View file

@ -2072,7 +2072,7 @@ static bool
lower_fs_prolog_abi(nir_builder *b, nir_intrinsic_instr *intr, UNUSED void *_)
{
if (intr->intrinsic != nir_intrinsic_load_polygon_stipple_agx &&
intr->intrinsic != nir_intrinsic_load_stat_query_address_agx)
intr->intrinsic != nir_intrinsic_load_stat_query_address_poly)
return false;
b->cursor = nir_before_instr(&intr->instr);