From cecc809ab476cf08b0d1bb0e97aec0a30216dddc Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 25 Jun 2024 11:01:32 +0200 Subject: [PATCH] radeonsi: fix crash in si_update_tess_io_layout_state for gfx8 and earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: (cherry picked from commit a7a1e3d329f73e0c3c37113a98ab48be7848334e) --- .pick_status.json | 2 +- src/gallium/drivers/radeonsi/si_state_shaders.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 7ca6db92d8c..ef6f56c7dce 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp index 1ae91ab54eb..efc54f2b1ed 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp +++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp @@ -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 &&