Merge per-shader SVM nodes in the main update thread to avoid locking and resizing overhead
In a test file containing 1300 copies of the same shader, this reduces shader update time from 3.1 sec to 0.05 sec. Thanks to @swerner for noticing this issue. Reviewers: brecht, sergey, swerner Subscribers: swerner Differential Revision: https://developer.blender.org/D5376
This commit is contained in:
@@ -50,13 +50,10 @@ class SVMShaderManager : public ShaderManager {
|
||||
void device_free(Device *device, DeviceScene *dscene, Scene *scene);
|
||||
|
||||
protected:
|
||||
/* Lock used to synchronize threaded nodes compilation. */
|
||||
thread_spin_lock nodes_lock_;
|
||||
|
||||
void device_update_shader(Scene *scene,
|
||||
Shader *shader,
|
||||
Progress *progress,
|
||||
array<int4> *global_svm_nodes);
|
||||
array<int4> *svm_nodes);
|
||||
};
|
||||
|
||||
/* Graph Compiler */
|
||||
|
||||
Reference in New Issue
Block a user