nir: add bindless_sampler_agx intrinsic

to facilitate pushing on AGX.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36127>
This commit is contained in:
Alyssa Rosenzweig 2025-07-14 19:11:02 -04:00 committed by Marge Bot
parent 58cc66238a
commit 24c708564f
3 changed files with 8 additions and 0 deletions

View file

@ -729,6 +729,7 @@ visit_intrinsic(nir_intrinsic_instr *instr, struct divergence_state *state)
case nir_intrinsic_load_constant_agx:
case nir_intrinsic_load_texture_handle_agx:
case nir_intrinsic_bindless_image_agx:
case nir_intrinsic_bindless_sampler_agx:
case nir_intrinsic_load_reg_indirect:
case nir_intrinsic_load_const_ir3:
case nir_intrinsic_load_frag_size_ir3:

View file

@ -2340,6 +2340,12 @@ load("exported_agx", [], [BASE], [CAN_ELIMINATE])
intrinsic("bindless_image_agx", [1], dest_comp=1, bit_sizes=[32],
indices=[DESC_SET], flags=[CAN_ELIMINATE, CAN_REORDER])
# AGX-specific bindless sampler handle specifier. Takes both a byte offset into the
# descriptor set (first source) and an index into the global heap (second
# source) to allow optimal pushing heuristics.
intrinsic("bindless_sampler_agx", [1, 1], dest_comp=1, bit_sizes=[16],
indices=[DESC_SET], flags=[CAN_ELIMINATE, CAN_REORDER])
# Intel-specific query for loading from the isl_image_param struct passed
# into the shader as a uniform. The variable is a deref to the image
# variable. The const index specifies which of the six parameters to load.

View file

@ -240,6 +240,7 @@ can_move_intrinsic(nir_intrinsic_instr *instr, opt_preamble_ctx *ctx)
case nir_intrinsic_load_const_ir3:
case nir_intrinsic_load_constant_agx:
case nir_intrinsic_bindless_image_agx:
case nir_intrinsic_bindless_sampler_agx:
return can_move_srcs(&instr->instr, ctx);
/* Image/SSBO loads can be moved if they are CAN_REORDER and their