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 <nick.hamilton@imgtec.com>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39327>
This commit is contained in:
Nick Hamilton 2026-01-14 15:17:52 +00:00 committed by Marge Bot
parent 0eb3eaa806
commit 69a56d33de

View file

@ -429,6 +429,9 @@ static nir_def *lower_tex_shadow(nir_builder *b,
{ {
nir_def *result_comps[NIR_MAX_VEC_COMPONENTS]; 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) { for (unsigned u = 0; u < data->num_components; ++u) {
result_comps[u] = result_comps[u] =
nir_alphatst_pco(b, nir_channel(b, data, u), comparator, compare_op); nir_alphatst_pco(b, nir_channel(b, data, u), comparator, compare_op);