diff options
Diffstat (limited to 'intern/cycles/render/svm.cpp')
-rw-r--r-- | intern/cycles/render/svm.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index 069c3e3043a..352bed8f0f2 100644 --- a/intern/cycles/render/svm.cpp +++ b/intern/cycles/render/svm.cpp @@ -671,8 +671,9 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty } /* for the bump shader we need add a node to store the shader state */ + bool need_bump_state = (type == SHADER_TYPE_BUMP) && (shader->displacement_method == DISPLACE_BOTH); int bump_state_offset = SVM_STACK_INVALID; - if(type == SHADER_TYPE_BUMP) { + if(need_bump_state) { bump_state_offset = stack_find_offset(SVM_BUMP_EVAL_STATE_SIZE); add_node(NODE_ENTER_BUMP_EVAL, bump_state_offset); } @@ -714,7 +715,7 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty } /* add node to restore state after bump shader has finished */ - if(type == SHADER_TYPE_BUMP) { + if(need_bump_state) { add_node(NODE_LEAVE_BUMP_EVAL, bump_state_offset); } |