Cycles: Implement threaded SVM nodes compilation
The title says it all actually. From tests with barber shop scene here gives 2-3x speedup for shader compilation on my oldie i7 machine. The gain is mainly due to textures metadata query from jpeg files (which seems to requite de-compression before metadata can be read). But in theory could give nice improvements for scenes with huge node trees as well (i'm talking about node trees of complexity of fractal which we had reports about in the past). Reviewers: juicyfruit, dingto, lukasstockner97, brecht Reviewed By: brecht Subscribers: monio, Blendify Differential Revision: https://developer.blender.org/D2215
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "util_set.h"
|
||||
#include "util_string.h"
|
||||
#include "util_thread.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
@@ -46,6 +47,15 @@ public:
|
||||
|
||||
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress);
|
||||
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,
|
||||
vector<int4> *global_svm_nodes);
|
||||
};
|
||||
|
||||
/* Graph Compiler */
|
||||
@@ -200,7 +210,7 @@ protected:
|
||||
/* compile */
|
||||
void compile_type(Shader *shader, ShaderGraph *graph, ShaderType type);
|
||||
|
||||
vector<int4> svm_nodes;
|
||||
vector<int4> current_svm_nodes;
|
||||
ShaderType current_type;
|
||||
Shader *current_shader;
|
||||
ShaderGraph *current_graph;
|
||||
|
Reference in New Issue
Block a user