Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-05-02 03:34:56 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-05-03 02:21:12 +0300
commit3bc44233c08dfc4af0cff89a14681f86dfebf5ae (patch)
tree1dea6e093f04cd29ef78c7dd64d1164fef17dd2d /intern/cycles/render/svm.h
parent5a964664d6cf54deb3d5590f8581683f865af747 (diff)
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
Diffstat (limited to 'intern/cycles/render/svm.h')
-rw-r--r--intern/cycles/render/svm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index a4ca68e1d8d..85b4b9c419f 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -46,7 +46,10 @@ class SVMShaderManager : public ShaderManager {
void reset(Scene *scene);
- void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress);
+ void device_update_specific(Device *device,
+ DeviceScene *dscene,
+ Scene *scene,
+ Progress &progress) override;
void device_free(Device *device, DeviceScene *dscene, Scene *scene);
protected: