Revert "Use one context per OSL thread. Not sure if this actually works, but the...
[blender.git] / intern / cycles / kernel / kernel_emission.h
index 9032d7d4a4109aedd15df0f41ed1ad121654079b..53d53b4bedd498b71aed4e21aaa56dec566fca45 100644 (file)
@@ -54,6 +54,8 @@ __device float3 direct_emissive_eval(KernelGlobals *kg, float rando,
                        eval = make_float3(0.0f, 0.0f, 0.0f);
        }
 
+       shader_release(kg, &sd);
+
        return eval;
 }
 
@@ -162,6 +164,7 @@ __device float3 indirect_background(KernelGlobals *kg, Ray *ray, int path_flag,
        ShaderData sd;
        shader_setup_from_background(kg, &sd, ray);
        float3 L = shader_eval_background(kg, &sd, path_flag);
+       shader_release(kg, &sd);
 
 #ifdef __BACKGROUND_MIS__
        /* check if background light exists or if we should skip pdf */