Cycles OSL minor optimizations: recycle shading context, don't do memory
[blender.git] / intern / cycles / kernel / osl / bsdf_phong_ramp.cpp
index fb144be7e5074ff36a69fd810b48741aad57545c..ef656ee7d5f48700e05764aab7774fdec79ddeba 100644 (file)
@@ -54,7 +54,7 @@ public:
 
        void setup()
        {
-               sc.N = TO_FLOAT3(N);
+               sc.prim = this;
                m_shaderdata_flag = bsdf_phong_ramp_setup(&sc);
 
                for(int i = 0; i < 8; i++)
@@ -100,7 +100,7 @@ public:
 ClosureParam *closure_bsdf_phong_ramp_params()
 {
        static ClosureParam params[] = {
-               CLOSURE_VECTOR_PARAM(PhongRampClosure, N),
+               CLOSURE_FLOAT3_PARAM(PhongRampClosure, sc.N),
                CLOSURE_FLOAT_PARAM(PhongRampClosure, sc.data0),
                CLOSURE_COLOR_ARRAY_PARAM(PhongRampClosure, colors, 8),
                CLOSURE_STRING_KEYPARAM("label"),