pco: Fix pco_last_igrp returning the first element instead of the last

Because of a previous refactor, pco_last_igrp was incorrectly changed to return
the first entry in a linked list instead of the last. Update pco_last_igrp to
return the last entry in a linked list.

The following CTS tests now pass:
dEQP-GLES3.functional.shaders.switch.conditional_fall_through_2_dynamic_fragment
dEQP-GLES3.functional.shaders.switch.conditional_fall_through_dynamic_fragment
dEQP-GLES3.functional.shaders.switch.conditional_fall_through_uniform_fragment

Fixes: 719ece42c0 ("pco: Switch back to util/list")

Signed-off-by: Duncan Brawley <duncan.brawley@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41125>
This commit is contained in:
Duncan Brawley 2026-04-21 12:54:11 +01:00 committed by Marge Bot
parent aed60946a1
commit 7428af29f6

View file

@ -1559,7 +1559,7 @@ static inline pco_igrp *pco_last_igrp(pco_block *block)
if (list_is_empty(&block->instrs))
return NULL;
return list_first_entry(&block->instrs, pco_igrp, link);
return list_last_entry(&block->instrs, pco_igrp, link);
}
/**