Cycles: Revert previous fixes to intersect_all functions

While they prevent legit write past the array boundary error
those fixes introduced regression in behavior when having exact
max_hits transparent intersections and nothing else.

Previous code would have considered such case a totally opaque,
but it's not correct.

Fixes T48941: Some materials don't get transparent shadows anymore
This commit is contained in:
Sergey Sharybin
2016-07-26 16:30:13 +02:00
parent b91aea6096
commit 7030794171
5 changed files with 28 additions and 38 deletions

View File

@@ -75,12 +75,7 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, ShaderData *shadow_sd,
}
uint num_hits;
if(max_hits == 0) {
blocked = true;
num_hits = 0;
} else {
blocked = scene_intersect_shadow_all(kg, ray, hits, max_hits, &num_hits);
}
blocked = scene_intersect_shadow_all(kg, ray, hits, max_hits, &num_hits);
/* if no opaque surface found but we did find transparent hits, shade them */
if(!blocked && num_hits > 0) {