Blender Git Loki

Git Commits -> Revision f9bc8c8

May 6, 2021, 09:25 (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: f9bc8c8ac522c67b715c9638b3715a4c6d8e2ae6
Parent Commit: 2577e31
Committed By: Stefan Werner
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