mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Cleanup: Cycles: Redundant point_intersect() in Metal-RT
It is unclear why there needs to be point_intersect() in the scene_intersect(): it feels that it mainly does redundant work. The main part that is needed is to set the prim, type, and u,v coordinates. There might be some non-obvious reason for this to exist, but it really needs to be done explicitly with a comment. This call was quietly introduced by !111795. Pull Request: https://projects.blender.org/blender/blender/pulls/162808
This commit is contained in:
parent
404d84dba5
commit
fd84292868
1 changed files with 4 additions and 33 deletions
|
|
@ -247,39 +247,10 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg,
|
|||
else if (kernel_data.bvh.have_points &&
|
||||
intersection.type == metal::raytracing::intersection_type::bounding_box)
|
||||
{
|
||||
const int object = intersection.instance_id;
|
||||
const uint prim = intersection.primitive_id + intersection.user_instance_id;
|
||||
const int prim_type = kernel_data_fetch(objects, object).primitive_type;
|
||||
|
||||
if (!(kernel_data_fetch(object_flag, object) & SD_OBJECT_TRANSFORM_APPLIED)) {
|
||||
float3 idir;
|
||||
# if defined(__METALRT_MOTION__)
|
||||
bvh_instance_motion_push(nullptr, object, ray, &r.origin, &r.direction, &idir);
|
||||
# else
|
||||
bvh_instance_push(nullptr, object, ray, &r.origin, &r.direction, &idir);
|
||||
# endif
|
||||
}
|
||||
|
||||
if (prim_type & PRIMITIVE_POINT) {
|
||||
if (!point_intersect(nullptr,
|
||||
isect,
|
||||
r.origin,
|
||||
r.direction,
|
||||
ray->tmin,
|
||||
ray->tmax,
|
||||
object,
|
||||
prim,
|
||||
ray->time,
|
||||
prim_type))
|
||||
{
|
||||
/* Shouldn't get here */
|
||||
kernel_assert(!"Intersection mismatch");
|
||||
isect->t = ray->tmax;
|
||||
isect->type = PRIMITIVE_NONE;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
isect->prim = intersection.primitive_id + intersection.user_instance_id;
|
||||
isect->type = kernel_data_fetch(objects, intersection.instance_id).primitive_type;
|
||||
isect->u = 0.0f;
|
||||
isect->v = 0.0f;
|
||||
}
|
||||
#endif /* __POINTCLOUD__ */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue