diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2015-07-29 23:04:36 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2015-07-29 23:04:36 +0300 |
commit | 4737b1246241fd575921f93ddf229da656c7fb5a (patch) | |
tree | a7a1e5e4423b212f4a4fde8a2f751cec914f8352 | |
parent | d49703b298ebab297fe3c3ecb337cd0a6fa78611 (diff) |
Cycles: Fix issue in closure merge function.
* Did not check data2, this partially fixes T45583.
* Initialize data2 in some closures to avoid potential problems.
Differential Revision: https://developer.blender.org/D1436
-rw-r--r-- | intern/cycles/kernel/kernel_shader.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_closure.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index 94e13028599..6b560f5fdb2 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -459,7 +459,7 @@ ccl_device void shader_merge_closures(ShaderData *sd) continue; #endif - if(!(sci->type == scj->type && sci->data0 == scj->data0 && sci->data1 == scj->data1)) + if(!(sci->type == scj->type && sci->data0 == scj->data0 && sci->data1 == scj->data1 && sci->data2 == scj->data2)) continue; if(CLOSURE_IS_BSDF_OR_BSSRDF(sci->type)) { diff --git a/intern/cycles/kernel/svm/svm_closure.h b/intern/cycles/kernel/svm/svm_closure.h index 20a6cb8cd45..20105fd84f0 100644 --- a/intern/cycles/kernel/svm/svm_closure.h +++ b/intern/cycles/kernel/svm/svm_closure.h @@ -30,6 +30,7 @@ ccl_device void svm_node_glass_setup(ShaderData *sd, ShaderClosure *sc, int type else { sc->data0 = 0.0f; sc->data1 = 0.0f; + sc->data2 = 0.0f; ccl_fetch(sd, flag) |= bsdf_reflection_setup(sc); } } @@ -393,6 +394,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float * sc->N = N; sc->data0 = 0.0f; sc->data1 = 0.0f; + sc->data2 = 0.0f; ccl_fetch(sd, flag) |= bsdf_transparent_setup(sc); } } @@ -545,6 +547,7 @@ ccl_device void svm_node_closure_volume(KernelGlobals *kg, ShaderData *sd, float if(sc) { sc->data0 = param2; /* g */ sc->data1 = 0.0f; + sc->data2 = 0.0f; ccl_fetch(sd, flag) |= volume_henyey_greenstein_setup(sc); } break; |