Cycles OSL minor optimizations: recycle shading context, don't do memory
[blender.git] / intern / cycles / kernel / osl / bsdf_diffuse_ramp.cpp
index 7189f99a822aa4ca3330d358ae32caafaa3ff2c1..a320bea118a6a3143c26609400ec112666e48dbc 100644 (file)
@@ -55,7 +55,7 @@ public:
 
        void setup()
        {
 
        void setup()
        {
-               sc.N = TO_FLOAT3(N);
+               sc.prim = this;
                m_shaderdata_flag = bsdf_diffuse_ramp_setup(&sc);
 
                for(int i = 0; i < 8; i++)
                m_shaderdata_flag = bsdf_diffuse_ramp_setup(&sc);
 
                for(int i = 0; i < 8; i++)
@@ -101,7 +101,7 @@ public:
 ClosureParam *closure_bsdf_diffuse_ramp_params()
 {
        static ClosureParam params[] = {
 ClosureParam *closure_bsdf_diffuse_ramp_params()
 {
        static ClosureParam params[] = {
-               CLOSURE_VECTOR_PARAM(DiffuseRampClosure, N),
+               CLOSURE_FLOAT3_PARAM(DiffuseRampClosure, sc.N),
                CLOSURE_COLOR_ARRAY_PARAM(DiffuseRampClosure, colors, 8),
                CLOSURE_STRING_KEYPARAM("label"),
            CLOSURE_FINISH_PARAM(DiffuseRampClosure)
                CLOSURE_COLOR_ARRAY_PARAM(DiffuseRampClosure, colors, 8),
                CLOSURE_STRING_KEYPARAM("label"),
            CLOSURE_FINISH_PARAM(DiffuseRampClosure)