diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-03 23:40:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-07 14:18:15 +0300 |
commit | d809853513c1333c9d9a22ab6ba35617b5ed2b8c (patch) | |
tree | 6c159a81df1f72c587a247ed31219705399a3788 /intern/cycles/kernel/geom | |
parent | d9c5f0d25fc91b069158ae1ab4fddc21bfd85846 (diff) |
Cleanup: simplify Cycles primitive attribute map storage
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r-- | intern/cycles/kernel/geom/geom_attribute.h | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_motion_curve.h | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/intern/cycles/kernel/geom/geom_attribute.h b/intern/cycles/kernel/geom/geom_attribute.h index 456608bfa22..e1b0e6fb81c 100644 --- a/intern/cycles/kernel/geom/geom_attribute.h +++ b/intern/cycles/kernel/geom/geom_attribute.h @@ -29,17 +29,11 @@ ccl_device_inline uint subd_triangle_patch(KernelGlobals *kg, const ShaderData * ccl_device_inline uint attribute_primitive_type(KernelGlobals *kg, const ShaderData *sd) { -#ifdef __HAIR__ - if (sd->type & PRIMITIVE_ALL_CURVE) { - return ATTR_PRIM_CURVE; - } - else -#endif - if (subd_triangle_patch(kg, sd) != ~0) { + if ((sd->type & PRIMITIVE_ALL_TRIANGLE) && subd_triangle_patch(kg, sd) != ~0) { return ATTR_PRIM_SUBD; } else { - return ATTR_PRIM_TRIANGLE; + return ATTR_PRIM_GEOMETRY; } } diff --git a/intern/cycles/kernel/geom/geom_motion_curve.h b/intern/cycles/kernel/geom/geom_motion_curve.h index 7380c506bf4..0e2a00e9d2e 100644 --- a/intern/cycles/kernel/geom/geom_motion_curve.h +++ b/intern/cycles/kernel/geom/geom_motion_curve.h @@ -36,7 +36,7 @@ ccl_device_inline int find_attribute_curve_motion(KernelGlobals *kg, * 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_attribute_map_offset(kg, object) + ATTR_PRIM_CURVE; + uint attr_offset = object_attribute_map_offset(kg, object) + ATTR_PRIM_GEOMETRY; uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset); while (attr_map.x != id) { |