Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/svm/svm_light_path.h
| Show All 12 Lines | |||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Light Path Node */ | /* Light Path Node */ | ||||
| ccl_device_noinline void svm_node_light_path(INTEGRATOR_STATE_CONST_ARGS, | template<uint node_feature_mask> | ||||
| ccl_device_noinline void svm_node_light_path(KernelGlobals kg, | |||||
| ConstIntegratorState state, | |||||
| ccl_private const ShaderData *sd, | ccl_private const ShaderData *sd, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint type, | uint type, | ||||
| uint out_offset, | uint out_offset, | ||||
| int path_flag) | int path_flag) | ||||
| { | { | ||||
| float info = 0.0f; | float info = 0.0f; | ||||
| Show All 27 Lines | case NODE_LP_backfacing: | ||||
| break; | break; | ||||
| case NODE_LP_ray_length: | case NODE_LP_ray_length: | ||||
| info = sd->ray_length; | info = sd->ray_length; | ||||
| break; | break; | ||||
| case NODE_LP_ray_depth: { | case NODE_LP_ray_depth: { | ||||
| /* Read bounce from difference location depending if this is a shadow | /* Read bounce from difference location depending if this is a shadow | ||||
| * path. It's a bit dubious to have integrate state details leak into | * path. It's a bit dubious to have integrate state details leak into | ||||
| * this function but hard to avoid currently. */ | * this function but hard to avoid currently. */ | ||||
| int bounce = (INTEGRATOR_STATE_IS_NULL) ? 0 : | int bounce = 0; | ||||
| (path_flag & PATH_RAY_SHADOW) ? INTEGRATOR_STATE(shadow_path, bounce) : | IF_KERNEL_NODES_FEATURE(LIGHT_PATH) | ||||
| INTEGRATOR_STATE(path, bounce); | { | ||||
| bounce = (path_flag & PATH_RAY_SHADOW) ? INTEGRATOR_STATE(state, shadow_path, bounce) : | |||||
| INTEGRATOR_STATE(state, path, bounce); | |||||
| } | |||||
| /* For background, light emission and shadow evaluation we from a | /* For background, light emission and shadow evaluation we from a | ||||
| * surface or volume we are effective one bounce further. */ | * surface or volume we are effective one bounce further. */ | ||||
| if (path_flag & (PATH_RAY_SHADOW | PATH_RAY_EMISSION)) { | if (path_flag & (PATH_RAY_SHADOW | PATH_RAY_EMISSION)) { | ||||
| bounce++; | bounce++; | ||||
| } | } | ||||
| info = (float)bounce; | info = (float)bounce; | ||||
| break; | break; | ||||
| } | } | ||||
| /* TODO */ | /* TODO */ | ||||
| case NODE_LP_ray_transparent: { | case NODE_LP_ray_transparent: { | ||||
| const int bounce = (INTEGRATOR_STATE_IS_NULL) ? | int bounce = 0; | ||||
| 0 : | IF_KERNEL_NODES_FEATURE(LIGHT_PATH) | ||||
| (path_flag & PATH_RAY_SHADOW) ? | { | ||||
| INTEGRATOR_STATE(shadow_path, transparent_bounce) : | bounce = (path_flag & PATH_RAY_SHADOW) ? | ||||
| INTEGRATOR_STATE(path, transparent_bounce); | INTEGRATOR_STATE(state, shadow_path, transparent_bounce) : | ||||
| INTEGRATOR_STATE(state, path, transparent_bounce); | |||||
| } | |||||
| info = (float)bounce; | info = (float)bounce; | ||||
| break; | break; | ||||
| } | } | ||||
| #if 0 | #if 0 | ||||
| case NODE_LP_ray_diffuse: | case NODE_LP_ray_diffuse: | ||||
| info = (float)state->diffuse_bounce; | info = (float)state->diffuse_bounce; | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||