From 13add95beba09060ee1f6e062119ba84f993c665 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 19 Jan 2024 16:42:22 +0100 Subject: [PATCH] radv: prevent crashes when a task shader is compiled unlinked with ESO That means the mesh shader stage would be NULL. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline_graphics.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index f5ac324bc94..162b739cc6d 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -1544,10 +1544,13 @@ radv_link_task(const struct radv_device *device, struct radv_shader_stage *task_ struct radv_shader_stage *mesh_stage, const struct radv_graphics_state_key *gfx_state) { assert(task_stage->nir->info.stage == MESA_SHADER_TASK); - assert(mesh_stage->nir->info.stage == MESA_SHADER_MESH); - /* Linking task and mesh shaders shouldn't do anything for now but keep it for consistency. */ - radv_link_shaders(device, task_stage, mesh_stage, gfx_state); + if (mesh_stage) { + assert(mesh_stage->nir->info.stage == MESA_SHADER_MESH); + + /* Linking task and mesh shaders shouldn't do anything for now but keep it for consistency. */ + radv_link_shaders(device, task_stage, mesh_stage, gfx_state); + } } static void