Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/bvh/bvh_traversal.h
| Show All 25 Lines | |||||
| /* This is a template BVH traversal function, where various features can be | /* This is a template BVH traversal function, where various features can be | ||||
| * enabled/disabled. This way we can compile optimized versions for each case | * enabled/disabled. This way we can compile optimized versions for each case | ||||
| * without new features slowing things down. | * without new features slowing things down. | ||||
| * | * | ||||
| * BVH_HAIR: hair curve rendering | * BVH_HAIR: hair curve rendering | ||||
| * BVH_MOTION: motion blur rendering | * BVH_MOTION: motion blur rendering | ||||
| */ | */ | ||||
| ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(ccl_global const KernelGlobals *kg, | ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals kg, | ||||
| ccl_private const Ray *ray, | ccl_private const Ray *ray, | ||||
| ccl_private Intersection *isect, | ccl_private Intersection *isect, | ||||
| const uint visibility) | const uint visibility) | ||||
| { | { | ||||
| /* todo: | /* todo: | ||||
| * - test if pushing distance on the stack helps (for non shadow rays) | * - test if pushing distance on the stack helps (for non shadow rays) | ||||
| * - separate version for shadow rays | * - separate version for shadow rays | ||||
| * - likely and unlikely for if() statements | * - likely and unlikely for if() statements | ||||
| ▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | #endif | ||||
| node_addr = traversal_stack[stack_ptr]; | node_addr = traversal_stack[stack_ptr]; | ||||
| --stack_ptr; | --stack_ptr; | ||||
| } | } | ||||
| } while (node_addr != ENTRYPOINT_SENTINEL); | } while (node_addr != ENTRYPOINT_SENTINEL); | ||||
| return (isect->prim != PRIM_NONE); | return (isect->prim != PRIM_NONE); | ||||
| } | } | ||||
| ccl_device_inline bool BVH_FUNCTION_NAME(ccl_global const KernelGlobals *kg, | ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals kg, | ||||
| ccl_private const Ray *ray, | ccl_private const Ray *ray, | ||||
| ccl_private Intersection *isect, | ccl_private Intersection *isect, | ||||
| const uint visibility) | const uint visibility) | ||||
| { | { | ||||
| return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect, visibility); | return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect, visibility); | ||||
| } | } | ||||
| #undef BVH_FUNCTION_NAME | #undef BVH_FUNCTION_NAME | ||||
| #undef BVH_FUNCTION_FEATURES | #undef BVH_FUNCTION_FEATURES | ||||
| #undef NODE_INTERSECT | #undef NODE_INTERSECT | ||||