From ee797f7159fed40e83c3e3bc3565544eb89d7046 Mon Sep 17 00:00:00 2001 From: Simon Perretta Date: Tue, 10 Mar 2026 11:25:21 +0000 Subject: [PATCH] pco: use vm/icm for tile buffer store coverage mask Use the valid/input coverage masks for tile buffer store coverage masks when running single/multi-sampled fragment shaders respectively. Fixes: 297a0c269aa ("pvr, pco: tile buffer support") Signed-off-by: Simon Perretta Reported-by: Nick Hamilton Acked-by: Frank Binns (cherry picked from commit 8eee60fa78ed215169c3d8b23b7f07b1caae0518) Part-of: --- .pick_status.json | 2 +- src/imagination/pco/pco_trans_nir.c | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 940c77bd629..5c8d742efa4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5274,7 +5274,7 @@ "description": "pco: use vm/icm for tile buffer store coverage mask", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "297a0c269aa76afd7422a7ed98af1686b671d523", "notes": null diff --git a/src/imagination/pco/pco_trans_nir.c b/src/imagination/pco/pco_trans_nir.c index 26acb2a742a..6c5dabea9cd 100644 --- a/src/imagination/pco/pco_trans_nir.c +++ b/src/imagination/pco/pco_trans_nir.c @@ -657,14 +657,26 @@ trans_store_output_fs(trans_ctx *tctx, nir_intrinsic_instr *intr, pco_ref src) pco_ref_new_ssa(tctx->func, pco_ref_get_bits(src), chans); pco_comp(&tctx->b, data_comp, addr_data, pco_ref_val16(2)); + pco_ref cov_mask_ss = pco_ref_new_ssa32(tctx->func); + pco_savmsk(&tctx->b, + cov_mask_ss, + pco_ref_null(), + .savmsk_mode = PCO_SAVMSK_MODE_VM); + + pco_ref cov_mask_ms = pco_ref_new_ssa32(tctx->func); + pco_savmsk(&tctx->b, + cov_mask_ms, + pco_ref_null(), + .savmsk_mode = PCO_SAVMSK_MODE_ICM); + pco_ref cov_mask = pco_ref_new_ssa32(tctx->func); - pco_ref sample_id = pco_ref_hwreg(PCO_SR_SAMP_NUM, PCO_REG_CLASS_SPEC); - pco_shift(&tctx->b, - cov_mask, - pco_one, - sample_id, - pco_ref_null(), - .shiftop = PCO_SHIFTOP_LSL); + pco_csel(&tctx->b, + cov_mask, + fs_is_single_sampled(tctx), + cov_mask_ss, + cov_mask_ms, + .tst_op_main = PCO_TST_OP_MAIN_GZERO, + .tst_type_main = PCO_TST_TYPE_MAIN_U32); return pco_st_tiled(&tctx->b, data_comp,