Fix #35684: cycles unable to use full 6GB of memory on NVidia Titan GPU. We now
[blender.git] / intern / cycles / kernel / kernel_primitive.h
index 4a06dff84bfba5c307c9fe58791459dd3931033f..636cfd065321701655c1f6cb8023c7d4153cdb19 100644 (file)
@@ -93,7 +93,11 @@ __device float3 primitive_tangent(KernelGlobals *kg, ShaderData *sd)
 {
 #ifdef __HAIR__
        if(sd->segment != ~0)
+#ifdef __DPDU__
                return normalize(sd->dPdu);
+#else
+               return make_float3(0.0f, 0.0f, 0.0f);
+#endif
 #endif
 
        /* try to create spherical tangent from generated coordinates */
@@ -108,7 +112,11 @@ __device float3 primitive_tangent(KernelGlobals *kg, ShaderData *sd)
        }
        else {
                /* otherwise use surface derivatives */
+#ifdef __DPDU__
                return normalize(sd->dPdu);
+#else
+               return make_float3(0.0f, 0.0f, 0.0f);
+#endif
        }
 }