Use one context per OSL thread. Not sure if this actually works, but the simple rende...
[blender.git] / intern / cycles / kernel / kernel_path.h
index acf17e695e3e97712c47ed6d8a7355f3c40f92aa..fc67ca98039b33bdeabb68e21ae420df041e450e 100644 (file)
@@ -395,8 +395,6 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
                label = shader_bsdf_sample(kg, &sd, bsdf_u, bsdf_v, &bsdf_eval,
                        &bsdf_omega_in, &bsdf_domega_in, &bsdf_pdf);
 
-               shader_release(kg, &sd);
-
                if(bsdf_pdf == 0.0f || bsdf_eval_is_zero(&bsdf_eval))
                        break;
 
@@ -569,8 +567,6 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
                label = shader_bsdf_sample(kg, &sd, bsdf_u, bsdf_v, &bsdf_eval,
                        &bsdf_omega_in, &bsdf_domega_in, &bsdf_pdf);
 
-               shader_release(kg, &sd);
-
                if(bsdf_pdf == 0.0f || bsdf_eval_is_zero(&bsdf_eval))
                        break;
 
@@ -862,7 +858,6 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
 
                /* continue in case of transparency */
                throughput *= shader_bsdf_transparency(kg, &sd);
-               shader_release(kg, &sd);
 
                if(is_zero(throughput))
                        break;