diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-10-31 19:21:07 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-11-03 16:35:43 +0300 |
commit | 91d320edc3cfb30443af4adbcb09bc3d7a609e1d (patch) | |
tree | 5fa112217c986e516ff30e3ba95556bc2b94d7ce /intern/cycles/blender/blender_geometry.cpp | |
parent | 9bc177d8ded4ba498762813a0d5106005fef0e67 (diff) |
Cycles: immediately store the used_shader list in Blender interface.
Uniform attributes require immediate access to the shader list
in object update code, so setting the field can't be deferred
to a background task. This required adding a parameter to the
clear method of Geometry.
Ref D2057
Diffstat (limited to 'intern/cycles/blender/blender_geometry.cpp')
-rw-r--r-- | intern/cycles/blender/blender_geometry.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_geometry.cpp b/intern/cycles/blender/blender_geometry.cpp index c7637fe8608..c9ac9d1068d 100644 --- a/intern/cycles/blender/blender_geometry.cpp +++ b/intern/cycles/blender/blender_geometry.cpp @@ -138,6 +138,9 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph, geom->name = ustring(b_ob_data.name().c_str()); + /* Store the shaders immediately for the object attribute code. */ + geom->used_shaders = used_shaders; + auto sync_func = [=]() mutable { if (progress.get_cancel()) return; @@ -146,15 +149,15 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph, if (geom_type == Geometry::HAIR) { Hair *hair = static_cast<Hair *>(geom); - sync_hair(b_depsgraph, b_ob, hair, used_shaders); + sync_hair(b_depsgraph, b_ob, hair); } else if (geom_type == Geometry::VOLUME) { Volume *volume = static_cast<Volume *>(geom); - sync_volume(b_ob, volume, used_shaders); + sync_volume(b_ob, volume); } else { Mesh *mesh = static_cast<Mesh *>(geom); - sync_mesh(b_depsgraph, b_ob, mesh, used_shaders); + sync_mesh(b_depsgraph, b_ob, mesh); } }; |