From 69a56d33defaf97bc4817b4a50bf745ae824a035 Mon Sep 17 00:00:00 2001 From: Nick Hamilton Date: Wed, 14 Jan 2026 15:17:52 +0000 Subject: [PATCH] pco: Fix for shadow sampler comparison not clamping the compare value When doing sample comparisons on shadow images the compare value should be clamped to [0,1] Fix: dEQP-VK.glsl.texture_functions.texture.samplercubearrayshadow_fragment Signed-off-by: Nick Hamilton Reviewed-by: Simon Perretta Part-of: --- src/imagination/pco/pco_nir_tex.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/imagination/pco/pco_nir_tex.c b/src/imagination/pco/pco_nir_tex.c index c46e34b3ee7..5420f2b3d7d 100644 --- a/src/imagination/pco/pco_nir_tex.c +++ b/src/imagination/pco/pco_nir_tex.c @@ -429,6 +429,9 @@ static nir_def *lower_tex_shadow(nir_builder *b, { nir_def *result_comps[NIR_MAX_VEC_COMPONENTS]; + /* Need to clamp the comparator to the range 0.0 - 1.0 */ + comparator = nir_fsat(b, comparator); + for (unsigned u = 0; u < data->num_components; ++u) { result_comps[u] = nir_alphatst_pco(b, nir_channel(b, data, u), comparator, compare_op);