From: Jason Ekstrand Date: Thu, 22 Oct 2015 03:42:23 +0000 (-0700) Subject: i965/vec4: Handle returns at the end of functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=403254988524e52a468f3cb370cc0014e3b54b38;p=mesa.git i965/vec4: Handle returns at the end of functions --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index ea1e3e7bbcf..e79a9f3b5b9 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp @@ -1521,7 +1521,13 @@ vec4_visitor::nir_emit_jump(nir_jump_instr *instr) break; case nir_jump_return: - /* fall through */ + /* This has to be the last block in the shader. We don't handle + * early returns. + */ + assert(nir_cf_node_next(&instr->instr.block->cf_node) == NULL && + instr->instr.block->cf_node.parent->type == nir_cf_node_function); + break; + default: unreachable("unknown jump"); }