Cycles: Fix MetalRT shadow all hit bug

This patch fixes a MetalRT issue where viable shadow hits are discounted based on the false assumption that hits are ordered by distance. With this patch, the following unit tests now pass:

- openvdb smoke
- shadow catcher pt transparent lamp only 0.8
- shadow catcher pt transparent lamp only 1.0

Pull Request: https://projects.blender.org/blender/blender/pulls/106276
This commit is contained in:
Michael Jones 2023-03-29 20:20:07 +02:00 committed by Michael Jones (Apple)
parent 8ce3bb6e05
commit 944a5854c6

@ -289,9 +289,8 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
}
if (ray_tmax >= max_recorded_t) {
/* Accept hit, so that we don't consider any more hits beyond the distance of the
* current hit anymore. */
payload.result = true;
/* Ray hits are not guaranteed to be ordered by distance so don't exit early here.
* Continue search. */
return true;
}