diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-07 18:05:25 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-07 22:35:24 +0300 |
commit | 4ee97f129a7ffbab5c5d544b661b8147369d1fd2 (patch) | |
tree | 2678f5e161a9c75de4d44f80f318c8ee3db2e489 /intern/cycles/kernel | |
parent | 9708b1f317a16f329bbd249c73003330c935d4f7 (diff) |
Cleanup: remove unnecessary data from LocalIntersection
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_bevel.h | 20 |
2 files changed, 10 insertions, 13 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 4a72f45f1a2..5000a96c331 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -866,9 +866,6 @@ typedef struct VolumeStack { /* Struct to gather multiple nearby intersections. */ typedef struct LocalIntersection { - Ray ray; - float3 weight[LOCAL_MAX_HITS]; - int num_hits; struct Intersection hits[LOCAL_MAX_HITS]; float3 Ng[LOCAL_MAX_HITS]; diff --git a/intern/cycles/kernel/svm/svm_bevel.h b/intern/cycles/kernel/svm/svm_bevel.h index 19176087180..60302b8e3d7 100644 --- a/intern/cycles/kernel/svm/svm_bevel.h +++ b/intern/cycles/kernel/svm/svm_bevel.h @@ -182,17 +182,17 @@ ccl_device float3 svm_bevel(INTEGRATOR_STATE_CONST_ARGS, float3 disk_P = (disk_r * cosf(phi)) * disk_T + (disk_r * sinf(phi)) * disk_B; /* Create ray. */ - Ray *ray = &isect.ray; - ray->P = sd->P + disk_N * disk_height + disk_P; - ray->D = -disk_N; - ray->t = 2.0f * disk_height; - ray->dP = differential_zero_compact(); - ray->dD = differential_zero_compact(); - ray->time = sd->time; + Ray ray ccl_optional_struct_init; + ray.P = sd->P + disk_N * disk_height + disk_P; + ray.D = -disk_N; + ray.t = 2.0f * disk_height; + ray.dP = differential_zero_compact(); + ray.dD = differential_zero_compact(); + ray.time = sd->time; /* Intersect with the same object. if multiple intersections are found it * will use at most LOCAL_MAX_HITS hits, a random subset of all hits. */ - scene_intersect_local(kg, ray, &isect, sd->object, &lcg_state, LOCAL_MAX_HITS); + scene_intersect_local(kg, &ray, &isect, sd->object, &lcg_state, LOCAL_MAX_HITS); int num_eval_hits = min(isect.num_hits, LOCAL_MAX_HITS); @@ -201,14 +201,14 @@ ccl_device float3 svm_bevel(INTEGRATOR_STATE_CONST_ARGS, float3 hit_P; if (sd->type & PRIMITIVE_TRIANGLE) { hit_P = triangle_refine_local( - kg, sd, ray->P, ray->D, ray->t, isect.hits[hit].object, isect.hits[hit].prim); + kg, sd, ray.P, ray.D, ray.t, isect.hits[hit].object, isect.hits[hit].prim); } # ifdef __OBJECT_MOTION__ else if (sd->type & PRIMITIVE_MOTION_TRIANGLE) { float3 verts[3]; motion_triangle_vertices(kg, sd->object, isect.hits[hit].prim, sd->time, verts); hit_P = motion_triangle_refine_local( - kg, sd, ray->P, ray->D, ray->t, isect.hits[hit].object, isect.hits[hit].prim, verts); + kg, sd, ray.P, ray.D, ray.t, isect.hits[hit].object, isect.hits[hit].prim, verts); } # endif /* __OBJECT_MOTION__ */ |