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>
(cherry picked from commit 7428af29f6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41269>
This commit is contained in:
Duncan Brawley 2026-04-21 12:54:11 +01:00 committed by Eric Engestrom
parent 05ed5acd07
commit 64127c4bd9
2 changed files with 2 additions and 2 deletions

View file

@ -2064,7 +2064,7 @@
"description": "pco: Fix pco_last_igrp returning the first element instead of the last",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "719ece42c0dcc7c682ba605fca43e76fac72756f",
"notes": null

View file

@ -1551,7 +1551,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);
}
/**