diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-29 18:42:20 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-31 13:58:18 +0300 |
commit | 0b4abd08b3e820e185313ccf741d31947198de91 (patch) | |
tree | 2776c4fbcfa5173f1b61a950a5eb5cc0ca4b27fd /intern/cycles/render/svm.h | |
parent | 0ffc603553bb6a5dd3ce96e88bc9be34356fc0cf (diff) |
Cycles: Experiment with use of runtime tag instead of set for SVM generation
This gives about 2x speedup (3.2sec vs. 11.9sec with 32716 handled nodes) when
updating shader for the shader tree.
Reviewers: brecht, juicyfruit, dingto, lukasstockner97
Differential Revision: https://developer.blender.org/D1700
Diffstat (limited to 'intern/cycles/render/svm.h')
-rw-r--r-- | intern/cycles/render/svm.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h index 4861de1f339..b86a00bf8ea 100644 --- a/intern/cycles/render/svm.h +++ b/intern/cycles/render/svm.h @@ -154,11 +154,26 @@ protected: /* Global state of the compiler accessible from the compilation routines. */ struct CompilerState { + CompilerState(ShaderGraph *graph); + + /* ** Global state, used by various compilation steps. ** */ + /* Set of nodes which were already compiled. */ ShaderNodeSet nodes_done; /* Set of closures which were already compiled. */ ShaderNodeSet closure_done; + + /* ** SVM nodes generation state ** */ + + /* Flag whether the node with corresponding ID was already compiled or + * not. Array element with index i corresponds to a node with such if. + * + * TODO(sergey): This is actually a copy of nodes_done just in another + * notation. We can de-duplicate this storage actually after switching + * all areas to use this flags array. + */ + vector<bool> nodes_done_flag; }; void stack_backup(StackBackup& backup, ShaderNodeSet& done); |