spirv: Emit nir_jump_halt after TerminateRay or IgnoreIntersection

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7356>
This commit is contained in:
Jason Ekstrand
2020-11-23 22:54:01 -06:00
committed by Marge Bot
parent 630e54a08b
commit 1d6434f02b
2 changed files with 2 additions and 4 deletions
+2 -2
View File
@@ -699,12 +699,10 @@ vtn_process_block(struct vtn_builder *b,
return NULL;
case SpvOpIgnoreIntersectionKHR:
b->has_early_terminate = true;
block->branch_type = vtn_branch_type_ignore_intersection;
return NULL;
case SpvOpTerminateRayKHR:
b->has_early_terminate = true;
block->branch_type = vtn_branch_type_terminate_ray;
return NULL;
@@ -980,12 +978,14 @@ vtn_emit_branch(struct vtn_builder *b, enum vtn_branch_type branch_type,
nir_intrinsic_instr_create(b->nb.shader,
nir_intrinsic_ignore_ray_intersection);
nir_builder_instr_insert(&b->nb, &ignore->instr);
nir_jump(&b->nb, nir_jump_halt);
break;
}
case vtn_branch_type_terminate_ray: {
nir_intrinsic_instr *terminate =
nir_intrinsic_instr_create(b->nb.shader, nir_intrinsic_terminate_ray);
nir_builder_instr_insert(&b->nb, &terminate->instr);
nir_jump(&b->nb, nir_jump_halt);
break;
}
default:
-2
View File
@@ -711,8 +711,6 @@ struct vtn_builder {
*
* - OpKill
* - OpTerminateInvocation
* - OpIgnoreIntersectionKHR
* - OpTerminateRayKHR
*
* However, in NIR, they're represented by regular intrinsics with no
* control-flow semantics. This means that the SSA form from the SPIR-V