nir: Add Panfrost intrinsics to lower sample mask

We want to lower this in NIR instead of the backend IR to give the driver a
chance to lower the "is multisampled?" system value, which makes more sense to
do in NIR. This gets rid of one of the magic compiler materialized sysvals.

Plus, this will let us constant fold away the lowering in Vulkan when we know
that the pipeline is single-sampled / multi-sampled.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
This commit is contained in:
Alyssa Rosenzweig 2023-02-06 10:49:29 -05:00 committed by Marge Bot
parent 8eceff48cd
commit 60bfc4deb9

View file

@ -1301,6 +1301,13 @@ load("sampler_lod_parameters_pan", [1], flags=[CAN_ELIMINATE, CAN_REORDER])
# Loads the sample position array on Bifrost, in a packed Arm-specific format
system_value("sample_positions_pan", 1, bit_sizes=[64])
# In a fragment shader, is the framebuffer single-sampled? 0/~0 bool
system_value("multisampled_pan", 1, bit_sizes=[32])
# In a fragment shader, the current coverage mask. Affected by writes.
intrinsic("load_coverage_mask_pan", [], 1, [], flags=[CAN_ELIMINATE],
sysval=True, bit_sizes=[32])
# R600 specific instrincs
#
# location where the tesselation data is stored in LDS