Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/geom_bvh_volume.h
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | #if defined(__KERNEL_SSE2__) | ||||
| Psplat[1] = ssef(P.y); | Psplat[1] = ssef(P.y); | ||||
| Psplat[2] = ssef(P.z); | Psplat[2] = ssef(P.z); | ||||
| ssef tsplat(0.0f, 0.0f, -isect->t, -isect->t); | ssef tsplat(0.0f, 0.0f, -isect->t, -isect->t); | ||||
| gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | ||||
| #endif | #endif | ||||
| IsectPrecalc isect_precalc; | |||||
| triangle_intersect_precalc(dir, &isect_precalc); | |||||
| /* traversal loop */ | /* traversal loop */ | ||||
| do { | do { | ||||
| do { | do { | ||||
| /* traverse internal nodes */ | /* traverse internal nodes */ | ||||
| while(nodeAddr >= 0 && nodeAddr != ENTRYPOINT_SENTINEL) { | while(nodeAddr >= 0 && nodeAddr != ENTRYPOINT_SENTINEL) { | ||||
| bool traverseChild0, traverseChild1; | bool traverseChild0, traverseChild1; | ||||
| int nodeAddrChild1; | int nodeAddrChild1; | ||||
| ▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | #endif | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* intersect ray against primitive */ | /* intersect ray against primitive */ | ||||
| uint type = kernel_tex_fetch(__prim_type, primAddr); | uint type = kernel_tex_fetch(__prim_type, primAddr); | ||||
| switch(type & PRIMITIVE_ALL) { | switch(type & PRIMITIVE_ALL) { | ||||
| case PRIMITIVE_TRIANGLE: { | case PRIMITIVE_TRIANGLE: { | ||||
| triangle_intersect(kg, isect, P, dir, visibility, object, primAddr); | triangle_intersect(kg, &isect_precalc, isect, P, dir, visibility, object, primAddr); | ||||
| break; | break; | ||||
| } | } | ||||
| #if FEATURE(BVH_MOTION) | #if FEATURE(BVH_MOTION) | ||||
| case PRIMITIVE_MOTION_TRIANGLE: { | case PRIMITIVE_MOTION_TRIANGLE: { | ||||
| motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, primAddr); | motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, primAddr); | ||||
| break; | break; | ||||
| } | } | ||||
| #endif | #endif | ||||
| Show All 22 Lines | #if FEATURE(BVH_INSTANCING) | ||||
| if(object_flag & SD_OBJECT_HAS_VOLUME) { | if(object_flag & SD_OBJECT_HAS_VOLUME) { | ||||
| #if FEATURE(BVH_MOTION) | #if FEATURE(BVH_MOTION) | ||||
| bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect->t, &ob_tfm); | bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect->t, &ob_tfm); | ||||
| #else | #else | ||||
| bvh_instance_push(kg, object, ray, &P, &dir, &idir, &isect->t); | bvh_instance_push(kg, object, ray, &P, &dir, &idir, &isect->t); | ||||
| #endif | #endif | ||||
| triangle_intersect_precalc(dir, &isect_precalc); | |||||
| #if defined(__KERNEL_SSE2__) | #if defined(__KERNEL_SSE2__) | ||||
| Psplat[0] = ssef(P.x); | Psplat[0] = ssef(P.x); | ||||
| Psplat[1] = ssef(P.y); | Psplat[1] = ssef(P.y); | ||||
| Psplat[2] = ssef(P.z); | Psplat[2] = ssef(P.z); | ||||
| tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); | tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); | ||||
| gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | ||||
| Show All 20 Lines | if(stackPtr >= 0) { | ||||
| /* instance pop */ | /* instance pop */ | ||||
| #if FEATURE(BVH_MOTION) | #if FEATURE(BVH_MOTION) | ||||
| bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, &isect->t, &ob_tfm); | bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, &isect->t, &ob_tfm); | ||||
| #else | #else | ||||
| bvh_instance_pop(kg, object, ray, &P, &dir, &idir, &isect->t); | bvh_instance_pop(kg, object, ray, &P, &dir, &idir, &isect->t); | ||||
| #endif | #endif | ||||
| triangle_intersect_precalc(dir, &isect_precalc); | |||||
| #if defined(__KERNEL_SSE2__) | #if defined(__KERNEL_SSE2__) | ||||
| Psplat[0] = ssef(P.x); | Psplat[0] = ssef(P.x); | ||||
| Psplat[1] = ssef(P.y); | Psplat[1] = ssef(P.y); | ||||
| Psplat[2] = ssef(P.z); | Psplat[2] = ssef(P.z); | ||||
| tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); | tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); | ||||
| gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | ||||
| Show All 16 Lines | |||||