diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-16 22:04:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-16 22:15:47 +0300 |
commit | 09ac6cae0941a6800d0fee1690b01d13e6283d9d (patch) | |
tree | 92129fcef3ec46b090b0c134326cd33b33226294 | |
parent | eff2fe9a722de23ea31adb2e5fa9b407cc2ea503 (diff) |
Cycles: Cleanup and optimization comment update
-rw-r--r-- | intern/cycles/kernel/geom/geom_curve.h | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_motion_curve.h | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/intern/cycles/kernel/geom/geom_curve.h b/intern/cycles/kernel/geom/geom_curve.h index b6d21c91916..5509fef3000 100644 --- a/intern/cycles/kernel/geom/geom_curve.h +++ b/intern/cycles/kernel/geom/geom_curve.h @@ -646,8 +646,8 @@ ccl_device_inline bool bvh_curve_intersect(KernelGlobals *kg, Intersection *isec float4 P_curve[2]; if(type & PRIMITIVE_CURVE) { - P_curve[0]= kernel_tex_fetch(__curve_keys, k0); - P_curve[1]= kernel_tex_fetch(__curve_keys, k1); + P_curve[0] = kernel_tex_fetch(__curve_keys, k0); + P_curve[1] = kernel_tex_fetch(__curve_keys, k1); } else { int fobject = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, curveAddr): object; diff --git a/intern/cycles/kernel/geom/geom_motion_curve.h b/intern/cycles/kernel/geom/geom_motion_curve.h index 1022a957b05..6de5aa7ea99 100644 --- a/intern/cycles/kernel/geom/geom_motion_curve.h +++ b/intern/cycles/kernel/geom/geom_motion_curve.h @@ -27,17 +27,22 @@ CCL_NAMESPACE_BEGIN ccl_device_inline int find_attribute_curve_motion(KernelGlobals *kg, int object, uint id, AttributeElement *elem) { - /* todo: find a better (faster) solution for this, maybe store offset per object */ + /* todo: find a better (faster) solution for this, maybe store offset per object. + * + * NOTE: currently it's not a bottleneck because in test scenes the loop below runs + * zero iterations and rendering is really slow with motion curves. For until other + * areas are speed up it's probably not so crucial to optimize this out. + */ uint attr_offset = object*kernel_data.bvh.attributes_map_stride + ATTR_PRIM_CURVE; uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset); - + while(attr_map.x != id) { attr_offset += ATTR_PRIM_TYPES; attr_map = kernel_tex_fetch(__attributes_map, attr_offset); } *elem = (AttributeElement)attr_map.y; - + /* return result */ return (attr_map.y == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : (int)attr_map.z; } |