tornavis/intern
Kévin Dietrich 12a06292af Cycles: optimize attributes device updates
When an `AttributeSet` is tagged as modified, which happens after the addition or
removal of an `Attribute` from the set, during the following GeometryManager device
update, we update and repack the kernel data for all attribute types. However, if we
only add or remove a `float` attribute, `float2` or `float3` attributes should not
be repacked for efficiency.

This patch adds some mechanisms to detect which attribute types are modified from
the AttributeSet.

Firstly, this adds an `AttrKernelDataType` to map the data type of the Attribute to
the one used in the kernel as there is no one to one match between the two since e.g.
`Transform` or `float4` data are stored as `float3s` in the kernel.

Then, this replaces the `AttributeSet.modified` boolean with a set of flags to detect
which types have been modified. There is no specific flag type (e.g.
`enum ModifiedType`), rather the flags used derive simply from the
`AttrKernelDataType` enumeration, to keep things synchronized.

The logic to remove an `Attribute` from the `AttributeSet` and tag the latter as modified
is centralized in a new `AttributeSet.remove` method taking an iterator as input.

Lastly, as some attributes like standard normals are not stored in the various
kernel attribute arrays (`DeviceScene::attribute_*`), the modified flags are only
set if the associated standard corresponds to an attribute which will be stored
in the kernel's attribute arrays. This makes it so adding or removing such attributes
does not trigger an unnecessary update of other type-related attributes.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11373
2021-05-26 12:18:28 +02:00
..
atomic Atomics: Add 16 bit fetch + AND and fetch + OR signed integer operations 2020-12-04 18:28:46 +01:00
audaspace Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
clog CLOG: Fix memleak in own recent improvement to CLOG filter. 2021-05-14 17:50:55 +02:00
cycles Cycles: optimize attributes device updates 2021-05-26 12:18:28 +02:00
dualcon Spelling: Then Versus Than 2020-10-19 08:43:08 -07:00
eigen Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
ffmpeg Cleanup: Fix deinterlace code block style 2021-05-07 17:22:12 +02:00
ghost Fix T88500: Constrain window top position (Win32) 2021-05-24 11:46:35 -07:00
glew-mx Cleanup: GPUState: Remove stack from the state manager and rename it 2020-08-18 21:30:10 +02:00
guardedalloc Cleanup: use our own code style for doxy-gen comment blocks 2021-04-09 19:00:04 +10:00
iksolver Cleanup: correct spelling in comments 2021-02-05 16:23:34 +11:00
itasc Cleanup: spelling 2021-05-21 22:23:07 +10:00
libc_compat Build: add more libc compatibility functions for upcoming libraries update 2020-07-09 18:10:05 +02:00
libmv Libmv: Add clang-format for third party sources 2021-04-01 11:32:47 +02:00
locale Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
mantaflow Fix T84649: Quick liquid causing crash on scale operation 2021-02-02 17:50:08 +01:00
memutil Cleanup: use C style doxygen comments 2020-09-12 16:33:34 +10:00
mikktspace Docs: Add readme for mikktspace 2021-05-23 13:57:22 -04:00
numaapi Cleanup: use angle-brackets for email addresses 2020-09-30 12:05:56 +10:00
opencolorio Remove unneeded code from previous commit. 2021-04-16 13:04:45 +02:00
opensubdiv Spelling: It's Versus Its 2020-10-19 08:12:33 -07:00
openvdb Cleanup: remove dead code in point cache and openvdb wrapper 2020-09-23 14:57:41 +02:00
quadriflow Quadriflow: Fix compilation error with C++17 2020-06-19 12:02:21 +02:00
rigidbody Fix missing "extern_bullet" library when building rigidbodies 2020-09-02 19:44:29 +02:00
sky Cleanup: Clang-tidy, readability-non-const-parameter. 2020-11-07 21:52:53 +05:30
utfconv Cleanup: spelling 2021-03-12 00:51:29 +11:00
CMakeLists.txt Atomic: Cover with unit tests 2020-11-19 17:19:48 +01:00