Blender Git Loki

Git Commits -> Revision 3bc4423

Revision 3bc4423 by Kévin Dietrich (master)
May 2, 2021, 23:21 (GMT)
Cycles: use reference count to detect used shaders

Shaders are only compiled if they are used by some other Node (Geometry, Light, etc.).
This usage detection is done before updating the Scene, however it fails at detecting
Shaders used by Procedurals not known to Cycles (e.g. ones defined by third party
applications), as Procedurals are only updated after the shaders are compiled.

To remedy this, we now use the Node reference counting mechanism to detect whether a
Shader is used and therefore should be compiled.

This removes `ShaderManager::update_shaders_used` as it is not needed anymore, however,
since it would also update the Shader ids, this is now performed in
`ShaderManager::device_update`, and a new virtual `device_update_specific` method was
added to handle device updates for SVM and OSL.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10965

Commit Details:

Full Hash: 3bc44233c08dfc4af0cff89a14681f86dfebf5ae
Parent Commit: 5a96466
Lines Changed: +53, -65

7 Modified Paths:

/intern/cycles/render/osl.cpp (+7, -7) (Diff)
/intern/cycles/render/osl.h (+4, -1) (Diff)
/intern/cycles/render/scene.cpp (+7, -6) (Diff)
/intern/cycles/render/shader.cpp (+21, -39) (Diff)
/intern/cycles/render/shader.h (+5, -6) (Diff)
/intern/cycles/render/svm.cpp (+5, -5) (Diff)
/intern/cycles/render/svm.h (+4, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021