Cycles: code refactoring to deduplicate the various BVH traversal variations.

Now there is a single BVH traversal code with #ifdefs for various features.
At runtime it will then select the appropriate variation to use depending if
instancing, hair or motion blur is in use.

This makes scenes without hair render a bit faster, especially after the
minimum width feature was added. It's not the most beautiful code, but we can't
use c++ templates and there were already 4 copies, adding 4 more to handle the
hair case separately would be too much.
This commit is contained in:
Brecht Van Lommel
2013-04-17 20:07:22 +00:00
parent f3f5e9553e
commit ed1a08382f
8 changed files with 421 additions and 569 deletions

View File

@@ -210,7 +210,7 @@ __device void subsurface_scatter_step(KernelGlobals *kg, ShaderData *sd, int sta
/* intersect with the same object. if multiple intersections are
* found it will randomly pick one of them */
Intersection isect;
if(scene_intersect_subsurface(kg, &ray, &isect, sd->object, u6) == 0)
if(!scene_intersect_subsurface(kg, &ray, &isect, sd->object, u6))
continue;
/* setup new shading point */