Cycles: svn merge -r39870:r40266 https://svn.blender.org/svnroot/bf-blender/trunk...
[blender-staging.git] / intern / cycles / util / util_color.h
index 60b738bfc51063e15fe5515ce494012144b7eb0e..8b4a175f49879954fdaeab681425f3900ece18d6 100644 (file)
@@ -40,6 +40,8 @@ __device float color_scene_linear_to_srgb(float c)
                return 1.055f * pow(c, 1.0f/2.4f) - 0.055f;
 }
 
+#ifndef __KERNEL_OPENCL__
+
 __device float3 color_srgb_to_scene_linear(float3 c)
 {
        return make_float3(
@@ -56,6 +58,13 @@ __device float3 color_scene_linear_to_srgb(float3 c)
                color_scene_linear_to_srgb(c.z));
 }
 
+#endif
+
+__device float linear_rgb_to_gray(float3 c)
+{
+       return c.x*0.2126f + c.y*0.7152f + c.z*0.0722f;
+}
+
 CCL_NAMESPACE_END
 
 #endif /* __UTIL_COLOR_H__ */