radeonsi: fix crash in si_update_tess_io_layout_state for gfx8 and earlier

si_set_patch_vertices was only called if tcs.current was non-NULL but
this condition is not enough for GFX9+ since vs is used as ls.

Add a check in si_update_tess_io_layout_state instead, and set
sctx->do_update_shaders for case where the ls_current is not yet
available.
This fix crashes on GFX6.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29876>
(cherry picked from commit a7a1e3d329)
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2024-06-25 11:01:32 +02:00 committed by Eric Engestrom
parent 15a02d9814
commit cecc809ab4
2 changed files with 6 additions and 1 deletions

View file

@ -114,7 +114,7 @@
"description": "radeonsi: fix crash in si_update_tess_io_layout_state for gfx8 and earlier",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -4450,6 +4450,11 @@ void si_update_tess_io_layout_state(struct si_context *sctx)
} else {
ls_current = sctx->shader.vs.current;
ls = sctx->shader.vs.cso;
if (!ls_current) {
sctx->do_update_shaders = true;
return;
}
}
if (sctx->last_ls == ls_current && sctx->last_tcs == tcs &&