nir/lower_task_shader: Don't fail adding a launch when last instruction is a jump

Fixes: 8aff8d3dd4 ("nir: Add common task shader lowering to make the backend's job easier.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18442>
This commit is contained in:
Caio Oliveira
2022-09-21 07:43:52 -07:00
committed by Marge Bot
parent 15e78caf8d
commit 3f4343c7cd

View File

@@ -417,7 +417,8 @@ nir_lower_task_shader(nir_shader *shader,
* If the shader already had a launch_mesh_workgroups by any chance,
* this will be removed.
*/
builder.cursor = nir_after_cf_list(&builder.impl->body);
nir_block *last_block = nir_impl_last_block(impl);
builder.cursor = nir_after_block_before_jump(last_block);
nir_launch_mesh_workgroups(&builder, nir_imm_zero(&builder, 3, 32));
}