Fix #108315: Illegal CUDA address with shadow-linked mesh emitters

A mistake in the intersection picking logic: if a mesh was hit at
least one intersection is to be recorded.

Pull Request: https://projects.blender.org/blender/blender/pulls/108320
This commit is contained in:
Sergey Sharybin
2023-05-26 17:36:24 +02:00
committed by Sergey Sharybin
parent 074abff87e
commit cc25a37bee

View File

@@ -61,7 +61,7 @@ ccl_device int shadow_linking_pick_mesh_intersection(KernelGlobals kg,
if (set_membership != LIGHT_LINK_MASK_ALL) {
++num_hits;
if ((linked_isect->prim == PRIM_NONE) && (lcg_step_float(lcg_state) < 1.0f / num_hits)) {
if ((linked_isect->prim == PRIM_NONE) || (lcg_step_float(lcg_state) < 1.0f / num_hits)) {
*linked_isect = current_isect;
}
}