ac/nir: Add new pass to lower intrinsics to shader args.
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 3 Jul 2023 15:07:18 +0000 (17:07 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 14 Jul 2023 12:17:24 +0000 (12:17 +0000)
commit5825e20dbf59f687973303ede2ac0836d6f405a2
treede40aafa831a6eeee9a66327ebc9be341ecf8419
parenta7f2d821ecf8a3bf670df6431fb5aaf1f39b98f3
ac/nir: Add new pass to lower intrinsics to shader args.

This is beneficial for intrinsics that do an algebraic
instruction such as bitfield extract on shader arguments,
because it allows NIR to be aware of these instructions and
optimize them together with other algebraic instructions in
the shader.

Currently, just handle subgroup_id and num_subgroups intrinsics.
More will be added here in the future.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
src/amd/common/ac_nir.c
src/amd/common/ac_nir.h