diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-10-26 17:37:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-10-28 14:43:42 +0300 |
commit | b7558e3c9c1478cb0d3a4881c73984d46a0c9603 (patch) | |
tree | cd08062a8b90389b754125c9c927bc1f145ba5e4 /intern/cycles/kernel/geom | |
parent | 0767683496f5c846edb5a068d8ad9b59a351d2e9 (diff) |
Cycles: internal support for per-instance and per-geometry attributes
The existing code for this was incomplete. Each instance can now have a set
of attributes stored separately from geometry attributes. Geometry attributes
take precedence over instance attributes.
Ref D2057
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r-- | intern/cycles/kernel/geom/geom_attribute.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/intern/cycles/kernel/geom/geom_attribute.h b/intern/cycles/kernel/geom/geom_attribute.h index e1b0e6fb81c..b37797ac21b 100644 --- a/intern/cycles/kernel/geom/geom_attribute.h +++ b/intern/cycles/kernel/geom/geom_attribute.h @@ -66,9 +66,17 @@ ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals *kg, while (attr_map.x != id) { if (UNLIKELY(attr_map.x == ATTR_STD_NONE)) { - return attribute_not_found(); + if (UNLIKELY(attr_map.y == 0)) { + return attribute_not_found(); + } + else { + /* Chain jump to a different part of the table. */ + attr_offset = attr_map.z; + } + } + else { + attr_offset += ATTR_PRIM_TYPES; } - attr_offset += ATTR_PRIM_TYPES; attr_map = kernel_tex_fetch(__attributes_map, attr_offset); } |