pco: support render target/layer id intrinsic

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
Simon Perretta 2025-07-02 13:27:26 +01:00 committed by Marge Bot
parent 78062fbb75
commit f4bc938a4d
2 changed files with 13 additions and 1 deletions

View file

@ -1426,6 +1426,12 @@ static pco_instr *trans_intr(trans_ctx *tctx, nir_intrinsic_instr *intr)
pco_ref_hwreg(PCO_SR_SAMP_NUM, PCO_REG_CLASS_SPEC));
break;
case nir_intrinsic_load_layer_id:
instr = pco_mov(&tctx->b,
dest,
pco_ref_hwreg(PCO_SR_RENDER_TGT_ID, PCO_REG_CLASS_SPEC));
break;
case nir_intrinsic_load_face_ccw_pco:
instr = pco_mov(&tctx->b,
dest,

View file

@ -1751,7 +1751,13 @@ static void pvr_alloc_fs_sysvals(pco_data *data, nir_shader *nir)
}
/* Clear built-in sysvals. */
BITSET_CLEAR(system_values_read, SYSTEM_VALUE_SAMPLE_ID);
gl_system_value builtin_sys_vals[] = {
SYSTEM_VALUE_SAMPLE_ID,
SYSTEM_VALUE_LAYER_ID,
};
for (unsigned u = 0; u < ARRAY_SIZE(builtin_sys_vals); ++u)
BITSET_CLEAR(system_values_read, builtin_sys_vals[u]);
assert(BITSET_IS_EMPTY(system_values_read));
}