855e29cd78
Branch instructions can point to the last shader block, which might be empty. In this case, the branch points to a clause that doesn't exists, leading to INVALID_ENC faults when the GPU tries to jump to this clause. Check if the block is a terminal block before updating the branch offset: jumping/branching to NULL is equivalent to a shader termination, so the default value of 0 works just fine for terminal branches. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8848>