mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
nir: Add image_texel_address intrinsics
Some hardware has an instruction to load the address of a texel in a writeable
image, given the coordinates ("LEA_IMAGE"). This operation is defined only for
uncompressed images, but it is well-defined regardless of the underlying
twiddling. As such, it is not expected to be produced by APIs but is useful for
internal lowering when it is known that images will be uncompressed (e.g.
because image_store does not support compression on the hardware).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>
This commit is contained in:
parent
c3ea2f8d20
commit
66656822e3
2 changed files with 9 additions and 0 deletions
|
|
@ -370,6 +370,13 @@ visit_intrinsic(nir_shader *shader, nir_intrinsic_instr *instr)
|
|||
instr->src[1].ssa->divergent;
|
||||
break;
|
||||
|
||||
case nir_intrinsic_image_texel_address:
|
||||
case nir_intrinsic_image_deref_texel_address:
|
||||
case nir_intrinsic_bindless_image_texel_address:
|
||||
is_divergent = (instr->src[0].ssa->divergent && (nir_intrinsic_access(instr) & ACCESS_NON_UNIFORM)) ||
|
||||
instr->src[1].ssa->divergent || instr->src[2].ssa->divergent;
|
||||
break;
|
||||
|
||||
case nir_intrinsic_image_load:
|
||||
case nir_intrinsic_image_deref_load:
|
||||
case nir_intrinsic_bindless_image_load:
|
||||
|
|
|
|||
|
|
@ -659,6 +659,8 @@ image("atomic", src_comp=[4, 1, 1], dest_comp=1, extra_indices=[ATOMIC_OP])
|
|||
image("atomic_swap", src_comp=[4, 1, 1, 1], dest_comp=1, extra_indices=[ATOMIC_OP])
|
||||
image("size", dest_comp=0, src_comp=[1], flags=[CAN_ELIMINATE, CAN_REORDER])
|
||||
image("samples", dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER])
|
||||
image("texel_address", dest_comp=1, src_comp=[4, 1],
|
||||
flags=[CAN_ELIMINATE, CAN_REORDER])
|
||||
# This returns true if all samples within the pixel have equal color values.
|
||||
image("samples_identical", dest_comp=1, src_comp=[4], flags=[CAN_ELIMINATE])
|
||||
# Non-uniform access is not lowered for image_descriptor_amd.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue