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 | |
parent | d9c5f0d25fc91b069158ae1ab4fddc21bfd85846 (diff) |
Cleanup: simplify Cycles primitive attribute map storage
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/geom/geom_attribute.h | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_motion_curve.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_shader.cpp | 4 |
4 files changed, 4 insertions, 15 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) { diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 1e1d161ff9b..bf34450df4b 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -725,9 +725,8 @@ typedef enum PrimitiveType { /* Attributes */ typedef enum AttributePrimitive { - ATTR_PRIM_TRIANGLE = 0, + ATTR_PRIM_GEOMETRY = 0, ATTR_PRIM_SUBD, - ATTR_PRIM_CURVE, ATTR_PRIM_TYPES } AttributePrimitive; diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp index db5ad06d3fc..0994bfaf950 100644 --- a/intern/cycles/kernel/osl/osl_shader.cpp +++ b/intern/cycles/kernel/osl/osl_shader.cpp @@ -382,10 +382,6 @@ int OSLShader::find_attribute(KernelGlobals *kg, { /* for OSL, a hash map is used to lookup the attribute by name. */ int object = sd->object * ATTR_PRIM_TYPES; -#ifdef __HAIR__ - if (sd->type & PRIMITIVE_ALL_CURVE) - object += ATTR_PRIM_CURVE; -#endif OSLGlobals::AttributeMap &attr_map = kg->osl->attribute_map[object]; ustring stdname(std::string("geom:") + |