diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index 750fe9f90f4..0a39445ca0b 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -3638,13 +3638,16 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr) ntq_emit_image_size(c, instr); break; - /* FIXME: the Vulkan and SPIR-V specs specify that OpTerminate (which + /* The Vulkan and SPIR-V specs specify that OpTerminate (which * is intended to match the semantics of GLSL's discard) should - * terminate the invocation immediately. Our implementation doesn't - * do that. What we do is actually a demote by removing the invocations - * from the sample mask. Maybe we could be more strict and force an - * early termination by emitting a (maybe conditional) jump to the - * end section of the fragment shader for affected invocations. + * terminate the invocation immediately but our implementation + * doesn't do that. We could implement it by emitting a jump to + * the end of the shader, however, we have not observed any gains + * from this in real use cases, and doing that would require us to + * always emit additional instructions for terminates, so we discarded + * that approach. See + * https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38381 + * for more details. */ case nir_intrinsic_terminate: c->emitted_discard = true;