From 1a246afe0330546a9fb526558d24b47c69e678d4 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 28 Dec 2015 19:30:43 +0500 Subject: Cycles: Use different approach for SVM summary report Use Summary structure to collect all summary related on the shader compilation process which then could be either simply reported to the log or be passed to some user interface or so. This is type of the summary / report which is most flexible and useful and something we could use for other parts like shader optimization. --- intern/cycles/render/svm.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'intern/cycles/render/svm.h') diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h index 02855f22fb3..bc641d2e00a 100644 --- a/intern/cycles/render/svm.h +++ b/intern/cycles/render/svm.h @@ -52,11 +52,27 @@ public: class SVMCompiler { public: + struct Summary { + Summary(); + + /* Number of SVM nodes shader was compiled into. */ + int num_svm_nodes; + + /* Peak stack usage during shader evaluation. */ + int peak_stack_usage; + + /* A full multiline description of the state of the compiler after + * compilation. + */ + string full_report() const; + }; + SVMCompiler(ShaderManager *shader_manager, ImageManager *image_manager); void compile(Scene *scene, Shader *shader, vector& svm_nodes, - int index); + int index, + Summary *summary = NULL); void stack_assign(ShaderOutput *output); void stack_assign(ShaderInput *input); -- cgit v1.2.3