From 60bfc4deb911d83932bc675f7e2fcd85a44213a6 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 6 Feb 2023 10:49:29 -0500 Subject: [PATCH] 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 Reviewed-by: Boris Brezillon Part-of: --- src/compiler/nir/nir_intrinsics.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 43e921068ef..93c5edf920f 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -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