Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 Jan 2017 17:11:42 +0000 (18:11 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 Jan 2017 17:11:42 +0000 (18:11 +0100)
30 files changed:
extern/gflags/README.blender
extern/gflags/src/gflags.cc
intern/cycles/blender/addon/ui.py
intern/cycles/kernel/bvh/bvh_subsurface.h
intern/cycles/kernel/bvh/bvh_volume.h
intern/cycles/kernel/bvh/bvh_volume_all.h
intern/cycles/kernel/bvh/qbvh_subsurface.h
intern/cycles/kernel/bvh/qbvh_volume.h
intern/cycles/kernel/bvh/qbvh_volume_all.h
intern/cycles/kernel/geom/geom_motion_triangle_shader.h
intern/cycles/kernel/geom/geom_object.h
intern/cycles/kernel/geom/geom_primitive.h
intern/cycles/kernel/geom/geom_triangle.h
intern/cycles/kernel/kernel_bake.h
intern/cycles/kernel/kernel_light.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_path_branched.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h
intern/cycles/kernel/svm/svm_wireframe.h
intern/cycles/render/object.cpp
intern/cycles/util/util_version.h
source/blender/editors/space_action/action_draw.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_dynamicpaint.c
source/blender/modifiers/intern/MOD_smoke.c
source/blender/modifiers/intern/MOD_softbody.c

index 0c8ea9a2be3d3070237e86d1cde91f60ae10d210..b48d4d5d1104051003d9e0373fac91d127d06b8d 100644 (file)
@@ -18,6 +18,8 @@ Local modifications:
 - Applied some modifications from fork https://github.com/Nazg-Gul/gflags.git
   (see https://github.com/gflags/gflags/pull/129)
 
-- Avoid attemot of acquiring mutex lock in FlagRegistry::GlobalRegistry when
+- Avoid attempt of acquiring mutex lock in FlagRegistry::GlobalRegistry when
   doing static flags initialization. See d81dd2d in Blender repository.
 
+- Made `google::{anonymous}::FlagValue::ValueSize() const` inlined, so it does
+  not trigger strict compiler warning.
\ No newline at end of file
index 7abe1f70da366c1dfd321cba098a3c6ccf35c0b0..6dcc5170bcc4409a2372a521726e908a4d00d7c2 100644 (file)
@@ -218,7 +218,7 @@ class FlagValue {
   bool Equal(const FlagValue& x) const;
   FlagValue* New() const;   // creates a new one with default value
   void CopyFrom(const FlagValue& x);
-  int ValueSize() const;
+  inline int ValueSize() const;
 
   // Calls the given validate-fn on value_buffer_, and returns
   // whatever it returns.  But first casts validate_fn_proto to a
@@ -443,7 +443,7 @@ void FlagValue::CopyFrom(const FlagValue& x) {
   }
 }
 
-int FlagValue::ValueSize() const {
+inline int FlagValue::ValueSize() const {
   if (type_ > FV_MAX_INDEX) {
     assert(false);  // unknown type
     return 0;
index 7a59698e15e059fc689af4cc7765988b64391028..a1e78623d29324514bd496b21b340e88a628485c 100644 (file)
@@ -217,7 +217,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
         draw_samples_info(layout, context)
 
 
-class CyclesRender_PT_geometery(CyclesButtonsPanel, Panel):
+class CyclesRender_PT_geometry(CyclesButtonsPanel, Panel):
     bl_label = "Geometry"
     bl_options = {'DEFAULT_CLOSED'}
 
index d9623c94b2e35de503f721421721e0a571325a35..889bbca21e2f47f0e3a59208addd831348a709df 100644 (file)
@@ -72,7 +72,7 @@ void BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
        ss_isect->num_hits = 0;
 
        const int object_flag = kernel_tex_fetch(__object_flag, subsurface_object);
-       if(!(object_flag & SD_TRANSFORM_APPLIED)) {
+       if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
 #if BVH_FEATURE(BVH_MOTION)
                Transform ob_itfm;
                bvh_instance_motion_push(kg,
index 107373c17dc14cf8fcd6654e07d84bde83ffd88d..57e5b8d736d6b1bb2982359adf04459baa2a903f 100644 (file)
@@ -236,9 +236,7 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
                                        /* instance push */
                                        object = kernel_tex_fetch(__prim_object, -prim_addr-1);
                                        int object_flag = kernel_tex_fetch(__object_flag, object);
-
                                        if(object_flag & SD_OBJECT_HAS_VOLUME) {
-
 #  if BVH_FEATURE(BVH_MOTION)
                                                bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect->t, &ob_itfm);
 #  else
index 529848ebe7b9412f0854eb14a849847aefa8f9a0..5a1accebaa04a59b893906b0c63ddf9b04dda85c 100644 (file)
@@ -287,7 +287,6 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
                                        /* instance push */
                                        object = kernel_tex_fetch(__prim_object, -prim_addr-1);
                                        int object_flag = kernel_tex_fetch(__object_flag, object);
-
                                        if(object_flag & SD_OBJECT_HAS_VOLUME) {
 
 #  if BVH_FEATURE(BVH_MOTION)
index ccd36df034a6d3070659f37bb84317a3f8400a18..84dc4003133a19f2d4220343515ce6bf9161ca50 100644 (file)
@@ -61,7 +61,7 @@ ccl_device void BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
        ss_isect->num_hits = 0;
 
        const int object_flag = kernel_tex_fetch(__object_flag, subsurface_object);
-       if(!(object_flag & SD_TRANSFORM_APPLIED)) {
+       if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
 #if BVH_FEATURE(BVH_MOTION)
                Transform ob_itfm;
                bvh_instance_motion_push(kg,
index 1e77d8e67ec82a2160370035c1b1ff7dc9ed7d57..dc6627e2dbb35a71e553553db26ea9db417a4cf7 100644 (file)
@@ -293,7 +293,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                                        /* Instance push. */
                                        object = kernel_tex_fetch(__prim_object, -prim_addr-1);
                                        int object_flag = kernel_tex_fetch(__object_flag, object);
-
                                        if(object_flag & SD_OBJECT_HAS_VOLUME) {
 #  if BVH_FEATURE(BVH_MOTION)
                                                bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect->t, &ob_itfm);
index eb48af6fc68ad0f464d6f595b2994788e16d1c73..ff1fa92af6ee56d5df0cfa7d60272f70998ff9ee 100644 (file)
@@ -344,9 +344,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                                        /* Instance push. */
                                        object = kernel_tex_fetch(__prim_object, -prim_addr-1);
                                        int object_flag = kernel_tex_fetch(__object_flag, object);
-
                                        if(object_flag & SD_OBJECT_HAS_VOLUME) {
-
 #  if BVH_FEATURE(BVH_MOTION)
                                                bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect_t, &ob_itfm);
 #  else
index c5dbc6a2f52a597a9498418d4a178904fec6f2ab..0e024a05db6700c3c7f6f7bc8c3cd56a04f86e82 100644 (file)
@@ -81,7 +81,7 @@ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals *kg,
        }
        /* Compute face normal. */
        float3 Ng;
-       if(ccl_fetch(sd, flag) & SD_NEGATIVE_SCALE_APPLIED) {
+       if(ccl_fetch(sd, object_flag) & SD_OBJECT_NEGATIVE_SCALE_APPLIED) {
                Ng = normalize(cross(verts[2] - verts[0], verts[1] - verts[0]));
        }
        else {
index 9f0fe032ba480f71b11520a1b93cdf56f6f54a43..f51b2d1865730fa22f3b71ab420e9a5388b30eb3 100644 (file)
@@ -113,7 +113,6 @@ ccl_device_inline Transform object_fetch_transform_motion(KernelGlobals *kg, int
 ccl_device_inline Transform object_fetch_transform_motion_test(KernelGlobals *kg, int object, float time, Transform *itfm)
 {
        int object_flag = kernel_tex_fetch(__object_flag, object);
-
        if(object_flag & SD_OBJECT_MOTION) {
                /* if we do motion blur */
                Transform tfm = object_fetch_transform_motion(kg, object, time);
index 4384c2093e9daa1d558b919f71a2a21acf98cf06..8a73bb2f78b1fbdaf807dfb6532e73a04b19ce71 100644 (file)
@@ -157,8 +157,9 @@ ccl_device_inline float4 primitive_motion_vector(KernelGlobals *kg, ShaderData *
        if(is_curve_primitive) {
                center = curve_motion_center_location(kg, sd);
 
-               if(!(ccl_fetch(sd, flag) & SD_TRANSFORM_APPLIED))
+               if(!(ccl_fetch(sd, object_flag) & SD_OBJECT_TRANSFORM_APPLIED)) {
                        object_position_transform(kg, sd, &center);
+               }
        }
        else
 #endif
@@ -181,7 +182,7 @@ ccl_device_inline float4 primitive_motion_vector(KernelGlobals *kg, ShaderData *
                motion_post = primitive_attribute_float3(kg, sd, desc, NULL, NULL);
 
 #ifdef __HAIR__
-               if(is_curve_primitive && (ccl_fetch(sd, flag) & SD_OBJECT_HAS_VERTEX_MOTION) == 0) {
+               if(is_curve_primitive && (ccl_fetch(sd, object_flag) & SD_OBJECT_HAS_VERTEX_MOTION) == 0) {
                        object_position_transform(kg, sd, &motion_pre);
                        object_position_transform(kg, sd, &motion_post);
                }
index 17538872ead285d0fdc2ee2ce9b29f195fed5c77..3229091bbb05a030f0fced9c002e30ad5d3a217c 100644 (file)
@@ -32,10 +32,12 @@ ccl_device_inline float3 triangle_normal(KernelGlobals *kg, ShaderData *sd)
        const float3 v2 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+2));
 
        /* return normal */
-       if(ccl_fetch(sd, flag) & SD_NEGATIVE_SCALE_APPLIED)
+       if(ccl_fetch(sd, object_flag) & SD_OBJECT_NEGATIVE_SCALE_APPLIED) {
                return normalize(cross(v2 - v0, v1 - v0));
-       else
+       }
+       else {
                return normalize(cross(v1 - v0, v2 - v0));
+       }
 }
 
 /* point and normal on triangle  */
@@ -46,20 +48,18 @@ ccl_device_inline void triangle_point_normal(KernelGlobals *kg, int object, int
        float3 v0 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+0));
        float3 v1 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+1));
        float3 v2 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+2));
-
        /* compute point */
        float t = 1.0f - u - v;
        *P = (u*v0 + v*v1 + t*v2);
-
        /* get object flags */
        int object_flag = kernel_tex_fetch(__object_flag, object);
-
        /* compute normal */
-       if(object_flag & SD_NEGATIVE_SCALE_APPLIED)
+       if(object_flag & SD_OBJECT_NEGATIVE_SCALE_APPLIED) {
                *Ng = normalize(cross(v2 - v0, v1 - v0));
-       else
+       }
+       else {
                *Ng = normalize(cross(v1 - v0, v2 - v0));
-
+       }
        /* shader`*/
        *shader = kernel_tex_fetch(__tri_shader, prim);
 }
index c32ac6ccf41217f92cd6be52c6e8278b3b31f622..5bcc57cdcdfe45d9d313f6154d954dff4a4e1022 100644 (file)
@@ -320,7 +320,7 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
                                 P, Ng, Ng,
                                 shader, object, prim,
                                 u, v, 1.0f, 0.5f,
-                                !(kernel_tex_fetch(__object_flag, object) & SD_TRANSFORM_APPLIED),
+                                !(kernel_tex_fetch(__object_flag, object) & SD_OBJECT_TRANSFORM_APPLIED),
                                 LAMP_NONE);
        sd.I = sd.N;
 
index d4cc36d14954336efab8fda891c5841cd2bc47e8..a2909cec1a1b1a8ca607bfa45c5660b3f662a6bf 100644 (file)
@@ -767,7 +767,7 @@ ccl_device void object_transform_light_sample(KernelGlobals *kg, LightSample *ls
 {
 #ifdef __INSTANCING__
        /* instance transform */
-       if(!(kernel_tex_fetch(__object_flag, object) & SD_TRANSFORM_APPLIED)) {
+       if(!(kernel_tex_fetch(__object_flag, object) & SD_OBJECT_TRANSFORM_APPLIED)) {
 #  ifdef __OBJECT_MOTION__
                Transform itfm;
                Transform tfm = object_fetch_transform_motion_test(kg, object, time, &itfm);
index e25f2597366cb357bf4f6cfc834479f375adce14..8ce9a4f02ecd671a0c0162af445a1cfa88cbd15a 100644 (file)
@@ -452,7 +452,7 @@ bool kernel_path_subsurface_scatter(
 #  ifdef __VOLUME__
                ss_indirect->need_update_volume_stack =
                        kernel_data.integrator.use_volumes &&
-                       ccl_fetch(sd, flag) & SD_OBJECT_INTERSECTS_VOLUME;
+                       ccl_fetch(sd, object_flag) & SD_OBJECT_INTERSECTS_VOLUME;
 #  endif  /* __VOLUME__ */
 
                /* compute lighting with the BSDF closure */
@@ -777,21 +777,25 @@ ccl_device_inline float4 kernel_path_integrate(KernelGlobals *kg,
 
                /* holdout */
 #ifdef __HOLDOUT__
-               if((sd.flag & (SD_HOLDOUT|SD_HOLDOUT_MASK)) && (state.flag & PATH_RAY_CAMERA)) {
+               if(((sd.flag & SD_HOLDOUT) ||
+                   (sd.object_flag & SD_OBJECT_HOLDOUT_MASK)) &&
+                  (state.flag & PATH_RAY_CAMERA))
+               {
                        if(kernel_data.background.transparent) {
                                float3 holdout_weight;
-                               
-                               if(sd.flag & SD_HOLDOUT_MASK)
+                               if(sd.object_flag & SD_OBJECT_HOLDOUT_MASK) {
                                        holdout_weight = make_float3(1.0f, 1.0f, 1.0f);
-                               else
+                               }
+                               else {
                                        holdout_weight = shader_holdout_eval(kg, &sd);
-
+                               }
                                /* any throughput is ok, should all be identical here */
                                L_transparent += average(holdout_weight*throughput);
                        }
 
-                       if(sd.flag & SD_HOLDOUT_MASK)
+                       if(sd.object_flag & SD_OBJECT_HOLDOUT_MASK) {
                                break;
+                       }
                }
 #endif  /* __HOLDOUT__ */
 
index 72a8d98ac00c482ffcaffe7400d32e53d0b4e16c..ff2b828795de8c64e848ec8eb500d9827226ae75 100644 (file)
@@ -167,8 +167,9 @@ ccl_device void kernel_branched_path_subsurface_scatter(KernelGlobals *kg,
                                                                          true);
 #ifdef __VOLUME__
                        Ray volume_ray = *ray;
-                       bool need_update_volume_stack = kernel_data.integrator.use_volumes &&
-                                                       ccl_fetch(sd, flag) & SD_OBJECT_INTERSECTS_VOLUME;
+                       bool need_update_volume_stack =
+                               kernel_data.integrator.use_volumes &&
+                               ccl_fetch(sd, object_flag) & SD_OBJECT_INTERSECTS_VOLUME;
 #endif  /* __VOLUME__ */
 
                        /* compute lighting with the BSDF closure */
@@ -473,21 +474,21 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in
 
                /* holdout */
 #ifdef __HOLDOUT__
-               if(sd.flag & (SD_HOLDOUT|SD_HOLDOUT_MASK)) {
+               if((sd.flag & SD_HOLDOUT) || (sd.object_flag & SD_OBJECT_HOLDOUT_MASK)) {
                        if(kernel_data.background.transparent) {
                                float3 holdout_weight;
-                               
-                               if(sd.flag & SD_HOLDOUT_MASK)
+                               if(sd.object_flag & SD_OBJECT_HOLDOUT_MASK) {
                                        holdout_weight = make_float3(1.0f, 1.0f, 1.0f);
-                               else
+                               }
+                               else {
                                        holdout_weight = shader_holdout_eval(kg, &sd);
-
+                               }
                                /* any throughput is ok, should all be identical here */
                                L_transparent += average(holdout_weight*throughput);
                        }
-
-                       if(sd.flag & SD_HOLDOUT_MASK)
+                       if(sd.object_flag & SD_OBJECT_HOLDOUT_MASK) {
                                break;
+                       }
                }
 #endif  /* __HOLDOUT__ */
 
index c1b3153d8fe89fe2fd539a6a4473341440f840ae..d0826e5e879cf580ece4d3b4573866eead9346d5 100644 (file)
@@ -38,7 +38,7 @@ CCL_NAMESPACE_BEGIN
 #ifdef __OBJECT_MOTION__
 ccl_device void shader_setup_object_transforms(KernelGlobals *kg, ShaderData *sd, float time)
 {
-       if(ccl_fetch(sd, flag) & SD_OBJECT_MOTION) {
+       if(ccl_fetch(sd, object_flag) & SD_OBJECT_MOTION) {
                ccl_fetch(sd, ob_tfm) = object_fetch_transform_motion(kg, ccl_fetch(sd, object), time);
                ccl_fetch(sd, ob_itfm) = transform_quick_inverse(ccl_fetch(sd, ob_tfm));
        }
@@ -59,7 +59,9 @@ ccl_device_noinline void shader_setup_from_ray(KernelGlobals *kg,
 #endif
 
        ccl_fetch(sd, type) = isect->type;
-       ccl_fetch(sd, flag) = kernel_tex_fetch(__object_flag, ccl_fetch(sd, object));
+       ccl_fetch(sd, flag) = 0;
+       ccl_fetch(sd, object_flag) = kernel_tex_fetch(__object_flag,
+                                                     ccl_fetch(sd, object));
 
        /* matrices and time */
 #ifdef __OBJECT_MOTION__
@@ -160,10 +162,11 @@ void shader_setup_from_subsurface(
         const Intersection *isect,
         const Ray *ray)
 {
-       bool backfacing = sd->flag & SD_BACKFACING;
+       const bool backfacing = sd->flag & SD_BACKFACING;
 
        /* object, matrices, time, ray_length stay the same */
-       sd->flag = kernel_tex_fetch(__object_flag, sd->object);
+       sd->flag = 0;
+       sd->object_flag = kernel_tex_fetch(__object_flag, sd->object);
        sd->prim = kernel_tex_fetch(__prim_index, isect->prim);
        sd->type = isect->type;
 
@@ -271,8 +274,10 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg,
        ccl_fetch(sd, ray_length) = t;
 
        ccl_fetch(sd, flag) = kernel_tex_fetch(__shader_flag, (ccl_fetch(sd, shader) & SHADER_MASK)*SHADER_SIZE);
+       ccl_fetch(sd, object_flag) = 0;
        if(ccl_fetch(sd, object) != OBJECT_NONE) {
-               ccl_fetch(sd, flag) |= kernel_tex_fetch(__object_flag, ccl_fetch(sd, object));
+               ccl_fetch(sd, object_flag) |= kernel_tex_fetch(__object_flag,
+                                                              ccl_fetch(sd, object));
 
 #ifdef __OBJECT_MOTION__
                shader_setup_object_transforms(kg, sd, time);
@@ -298,7 +303,7 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg,
                        ccl_fetch(sd, N) = triangle_smooth_normal(kg, ccl_fetch(sd, prim), ccl_fetch(sd, u), ccl_fetch(sd, v));
 
 #ifdef __INSTANCING__
-                       if(!(ccl_fetch(sd, flag) & SD_TRANSFORM_APPLIED)) {
+                       if(!(ccl_fetch(sd, object_flag) & SD_OBJECT_TRANSFORM_APPLIED)) {
                                object_normal_transform_auto(kg, sd, &ccl_fetch(sd, N));
                        }
 #endif
@@ -309,7 +314,7 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg,
                triangle_dPdudv(kg, ccl_fetch(sd, prim), &ccl_fetch(sd, dPdu), &ccl_fetch(sd, dPdv));
 
 #  ifdef __INSTANCING__
-               if(!(ccl_fetch(sd, flag) & SD_TRANSFORM_APPLIED)) {
+               if(!(ccl_fetch(sd, object_flag) & SD_OBJECT_TRANSFORM_APPLIED)) {
                        object_dir_transform_auto(kg, sd, &ccl_fetch(sd, dPdu));
                        object_dir_transform_auto(kg, sd, &ccl_fetch(sd, dPdv));
                }
@@ -364,7 +369,7 @@ ccl_device void shader_setup_from_displace(KernelGlobals *kg, ShaderData *sd,
                                 P, Ng, I,
                                 shader, object, prim,
                                 u, v, 0.0f, 0.5f,
-                                !(kernel_tex_fetch(__object_flag, object) & SD_TRANSFORM_APPLIED),
+                                !(kernel_tex_fetch(__object_flag, object) & SD_OBJECT_TRANSFORM_APPLIED),
                                 LAMP_NONE);
 }
 
@@ -379,6 +384,7 @@ ccl_device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderDat
        ccl_fetch(sd, I) = -ray->D;
        ccl_fetch(sd, shader) = kernel_data.background.surface_shader;
        ccl_fetch(sd, flag) = kernel_tex_fetch(__shader_flag, (ccl_fetch(sd, shader) & SHADER_MASK)*SHADER_SIZE);
+       ccl_fetch(sd, object_flag) = 0;
 #ifdef __OBJECT_MOTION__
        ccl_fetch(sd, time) = ray->time;
 #endif
@@ -420,6 +426,7 @@ ccl_device_inline void shader_setup_from_volume(KernelGlobals *kg, ShaderData *s
        sd->I = -ray->D;
        sd->shader = SHADER_NONE;
        sd->flag = 0;
+       sd->object_flag = 0;
 #ifdef __OBJECT_MOTION__
        sd->time = ray->time;
 #endif
@@ -1027,6 +1034,7 @@ ccl_device_inline void shader_eval_volume(KernelGlobals *kg,
        sd->num_closure = 0;
        sd->num_closure_extra = 0;
        sd->flag = 0;
+       sd->object_flag = 0;
 
        for(int i = 0; stack[i].shader != SHADER_NONE; i++) {
                /* setup shaderdata from stack. it's mostly setup already in
@@ -1034,11 +1042,12 @@ ccl_device_inline void shader_eval_volume(KernelGlobals *kg,
                sd->object = stack[i].object;
                sd->shader = stack[i].shader;
 
-               sd->flag &= ~(SD_SHADER_FLAGS|SD_OBJECT_FLAGS);
+               sd->flag &= ~SD_SHADER_FLAGS;
                sd->flag |= kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*SHADER_SIZE);
+               sd->object_flag &= ~SD_OBJECT_FLAGS;
 
                if(sd->object != OBJECT_NONE) {
-                       sd->flag |= kernel_tex_fetch(__object_flag, sd->object);
+                       sd->object_flag |= kernel_tex_fetch(__object_flag, sd->object);
 
 #ifdef __OBJECT_MOTION__
                        /* todo: this is inefficient for motion blur, we should be
index 4180465d1a13247dbccbd56492b68d5f45cf5965..b7af90cd739cd5a98788537c2689d89f41e2b505 100644 (file)
@@ -692,56 +692,108 @@ typedef enum ShaderContext {
 /* Shader Data
  *
  * Main shader state at a point on the surface or in a volume. All coordinates
- * are in world space. */
+ * are in world space.
+ */
 
 enum ShaderDataFlag {
-       /* runtime flags */
-       SD_BACKFACING      = (1 << 0),   /* backside of surface? */
-       SD_EMISSION        = (1 << 1),   /* have emissive closure? */
-       SD_BSDF            = (1 << 2),   /* have bsdf closure? */
-       SD_BSDF_HAS_EVAL   = (1 << 3),   /* have non-singular bsdf closure? */
-       SD_BSSRDF          = (1 << 4),   /* have bssrdf */
-       SD_HOLDOUT         = (1 << 5),   /* have holdout closure? */
-       SD_ABSORPTION      = (1 << 6),   /* have volume absorption closure? */
-       SD_SCATTER         = (1 << 7),   /* have volume phase closure? */
-       SD_AO              = (1 << 8),   /* have ao closure? */
-       SD_TRANSPARENT     = (1 << 9),  /* have transparent closure? */
+       /* Runtime flags. */
+
+       /* Set when ray hits backside of surface. */
+       SD_BACKFACING      = (1 << 0),
+       /* Shader has emissive closure. */
+       SD_EMISSION        = (1 << 1),
+       /* Shader has BSDF closure. */
+       SD_BSDF            = (1 << 2),
+       /* Shader has non-singular BSDF closure. */
+       SD_BSDF_HAS_EVAL   = (1 << 3),
+       /* Shader has BSSRDF closure. */
+       SD_BSSRDF          = (1 << 4),
+       /* Shader has holdout closure. */
+       SD_HOLDOUT         = (1 << 5),
+       /* Shader has volume absorption closure. */
+       SD_ABSORPTION      = (1 << 6),
+       /* Shader has have volume phase (scatter) closure. */
+       SD_SCATTER         = (1 << 7),
+       /* Shader has AO closure. */
+       SD_AO              = (1 << 8),
+       /* Shader has transparent closure. */
+       SD_TRANSPARENT     = (1 << 9),
+       /* BSDF requires LCG for evaluation. */
        SD_BSDF_NEEDS_LCG  = (1 << 10),
 
-       SD_CLOSURE_FLAGS = (SD_EMISSION|SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSSRDF|
-                           SD_HOLDOUT|SD_ABSORPTION|SD_SCATTER|SD_AO|
+       SD_CLOSURE_FLAGS = (SD_EMISSION |
+                           SD_BSDF |
+                           SD_BSDF_HAS_EVAL |
+                           SD_BSSRDF |
+                           SD_HOLDOUT |
+                           SD_ABSORPTION |
+                           SD_SCATTER |
+                           SD_AO |
                            SD_BSDF_NEEDS_LCG),
 
-       /* shader flags */
-       SD_USE_MIS                = (1 << 12),  /* direct light sample */
-       SD_HAS_TRANSPARENT_SHADOW = (1 << 13),  /* has transparent shadow */
-       SD_HAS_VOLUME             = (1 << 14),  /* has volume shader */
-       SD_HAS_ONLY_VOLUME        = (1 << 15),  /* has only volume shader, no surface */
-       SD_HETEROGENEOUS_VOLUME   = (1 << 16),  /* has heterogeneous volume */
-       SD_HAS_BSSRDF_BUMP        = (1 << 17),  /* bssrdf normal uses bump */
-       SD_VOLUME_EQUIANGULAR     = (1 << 18),  /* use equiangular sampling */
-       SD_VOLUME_MIS             = (1 << 19),  /* use multiple importance sampling */
-       SD_VOLUME_CUBIC           = (1 << 20),  /* use cubic interpolation for voxels */
-       SD_HAS_BUMP               = (1 << 21),  /* has data connected to the displacement input */
-       SD_HAS_DISPLACEMENT       = (1 << 22),  /* has true displacement */
-       SD_HAS_CONSTANT_EMISSION  = (1 << 23),  /* has constant emission (value stored in __shader_flag) */
-
-       SD_SHADER_FLAGS = (SD_USE_MIS|SD_HAS_TRANSPARENT_SHADOW|SD_HAS_VOLUME|
-                          SD_HAS_ONLY_VOLUME|SD_HETEROGENEOUS_VOLUME|
-                          SD_HAS_BSSRDF_BUMP|SD_VOLUME_EQUIANGULAR|SD_VOLUME_MIS|
-                          SD_VOLUME_CUBIC|SD_HAS_BUMP|SD_HAS_DISPLACEMENT|SD_HAS_CONSTANT_EMISSION),
-
-       /* object flags */
-       SD_HOLDOUT_MASK             = (1 << 24),  /* holdout for camera rays */
-       SD_OBJECT_MOTION            = (1 << 25),  /* has object motion blur */
-       SD_TRANSFORM_APPLIED        = (1 << 26),  /* vertices have transform applied */
-       SD_NEGATIVE_SCALE_APPLIED   = (1 << 27),  /* vertices have negative scale applied */
-       SD_OBJECT_HAS_VOLUME        = (1 << 28),  /* object has a volume shader */
-       SD_OBJECT_INTERSECTS_VOLUME = (1 << 29),  /* object intersects AABB of an object with volume shader */
-       SD_OBJECT_HAS_VERTEX_MOTION = (1 << 30),  /* has position for motion vertices */
-
-       SD_OBJECT_FLAGS = (SD_HOLDOUT_MASK|SD_OBJECT_MOTION|SD_TRANSFORM_APPLIED|
-                          SD_NEGATIVE_SCALE_APPLIED|SD_OBJECT_HAS_VOLUME|
+       /* Shader flags. */
+
+       /* direct light sample */
+       SD_USE_MIS                = (1 << 16),
+       /* Has transparent shadow. */
+       SD_HAS_TRANSPARENT_SHADOW = (1 << 17),
+       /* Has volume shader. */
+       SD_HAS_VOLUME             = (1 << 18),
+       /* Has only volume shader, no surface. */
+       SD_HAS_ONLY_VOLUME        = (1 << 19),
+       /* Has heterogeneous volume. */
+       SD_HETEROGENEOUS_VOLUME   = (1 << 20),
+       /* BSSRDF normal uses bump. */
+       SD_HAS_BSSRDF_BUMP        = (1 << 21),
+       /* Use equiangular volume sampling */
+       SD_VOLUME_EQUIANGULAR     = (1 << 22),
+       /* Use multiple importance volume sampling. */
+       SD_VOLUME_MIS             = (1 << 23),
+       /* Use cubic interpolation for voxels. */
+       SD_VOLUME_CUBIC           = (1 << 24),
+       /* Has data connected to the displacement input. */
+       SD_HAS_BUMP               = (1 << 25),
+       /* Has true displacement. */
+       SD_HAS_DISPLACEMENT       = (1 << 26),
+       /* Has constant emission (value stored in __shader_flag) */
+       SD_HAS_CONSTANT_EMISSION  = (1 << 27),
+
+       SD_SHADER_FLAGS = (SD_USE_MIS |
+                          SD_HAS_TRANSPARENT_SHADOW |
+                          SD_HAS_VOLUME |
+                          SD_HAS_ONLY_VOLUME |
+                          SD_HETEROGENEOUS_VOLUME|
+                          SD_HAS_BSSRDF_BUMP |
+                          SD_VOLUME_EQUIANGULAR |
+                          SD_VOLUME_MIS |
+                          SD_VOLUME_CUBIC |
+                          SD_HAS_BUMP |
+                          SD_HAS_DISPLACEMENT |
+                          SD_HAS_CONSTANT_EMISSION)
+};
+
+       /* Object flags. */
+enum ShaderDataObjectFlag {
+       /* Holdout for camera rays. */
+       SD_OBJECT_HOLDOUT_MASK           = (1 << 0),
+       /* Has object motion blur. */
+       SD_OBJECT_MOTION                 = (1 << 1),
+       /* Vertices have transform applied. */
+       SD_OBJECT_TRANSFORM_APPLIED      = (1 << 2),
+       /* Vertices have negative scale applied. */
+       SD_OBJECT_NEGATIVE_SCALE_APPLIED = (1 << 3),
+       /* Object has a volume shader. */
+       SD_OBJECT_HAS_VOLUME             = (1 << 4),
+       /* Object intersects AABB of an object with volume shader. */
+       SD_OBJECT_INTERSECTS_VOLUME      = (1 << 5),
+       /* Has position for motion vertices. */
+       SD_OBJECT_HAS_VERTEX_MOTION      = (1 << 6),
+
+       SD_OBJECT_FLAGS = (SD_OBJECT_HOLDOUT_MASK |
+                          SD_OBJECT_MOTION |
+                          SD_OBJECT_TRANSFORM_APPLIED |
+                          SD_OBJECT_NEGATIVE_SCALE_APPLIED |
+                          SD_OBJECT_HAS_VOLUME |
                           SD_OBJECT_INTERSECTS_VOLUME)
 };
 
@@ -780,6 +832,8 @@ typedef ccl_addr_space struct ShaderData {
        ccl_soa_member(int, shader);
        /* booleans describing shader, see ShaderDataFlag */
        ccl_soa_member(int, flag);
+       /* booleans describing object of the shader, see ShaderDataObjectFlag */
+       ccl_soa_member(int, object_flag);
 
        /* primitive id if there is one, ~0 otherwise */
        ccl_soa_member(int, prim);
index eeccf9a9641cc0552c0805205ea05e08ed6f7ca6..58bbdc339202dc4f350b824e13ca51a87cad13df 100644 (file)
@@ -712,7 +712,7 @@ bool OSLRenderServices::get_object_standard_attribute(KernelGlobals *kg, ShaderD
                else
                        motion_triangle_vertices(kg, sd->object, sd->prim, sd->time, P);
 
-               if(!(sd->flag & SD_TRANSFORM_APPLIED)) {
+               if(!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
                        object_position_transform(kg, sd, &P[0]);
                        object_position_transform(kg, sd, &P[1]);
                        object_position_transform(kg, sd, &P[2]);
index 435d1171d5cc4ee9809e271b266636c408d729d9..5d951b972ed08f708182b78aeb24e25debd136fd 100644 (file)
@@ -137,22 +137,22 @@ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao(
 
                /* holdout */
 #ifdef __HOLDOUT__
-               if((ccl_fetch(sd, flag) & (SD_HOLDOUT|SD_HOLDOUT_MASK)) &&
+               if(((ccl_fetch(sd, flag) & SD_HOLDOUT) ||
+                   (ccl_fetch(sd, object_flag) & SD_OBJECT_HOLDOUT_MASK)) &&
                   (state->flag & PATH_RAY_CAMERA))
                {
                        if(kernel_data.background.transparent) {
                                float3 holdout_weight;
-
-                               if(ccl_fetch(sd, flag) & SD_HOLDOUT_MASK)
+                               if(ccl_fetch(sd, object_flag) & SD_OBJECT_HOLDOUT_MASK) {
                                        holdout_weight = make_float3(1.0f, 1.0f, 1.0f);
-                               else
+                               }
+                               else {
                                        holdout_weight = shader_holdout_eval(kg, sd);
-
+                               }
                                /* any throughput is ok, should all be identical here */
                                L_transparent_coop[ray_index] += average(holdout_weight*throughput);
                        }
-
-                       if(ccl_fetch(sd, flag) & SD_HOLDOUT_MASK) {
+                       if(ccl_fetch(sd, object_flag) & SD_OBJECT_HOLDOUT_MASK) {
                                ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER);
                                *enqueue_flag = 1;
                        }
index 6eed9bc1a99a1dc560ed300833895fb36b7329a6..87e40791333b4a130115efe9c05f764afb729f1e 100644 (file)
@@ -57,7 +57,7 @@ ccl_device_inline float wireframe(KernelGlobals *kg,
                else
                        motion_triangle_vertices(kg, ccl_fetch(sd, object), ccl_fetch(sd, prim), ccl_fetch(sd, time), Co);
 
-               if(!(ccl_fetch(sd, flag) & SD_TRANSFORM_APPLIED)) {
+               if(!(ccl_fetch(sd, object_flag) & SD_OBJECT_TRANSFORM_APPLIED)) {
                        object_position_transform(kg, sd, &Co[0]);
                        object_position_transform(kg, sd, &Co[1]);
                        object_position_transform(kg, sd, &Co[2]);
index c592b62829eebdbe9839648e8d86982435925022..8342f3768362510054e1e33e10775aef5fa8941d 100644 (file)
@@ -410,7 +410,7 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s
 
        /* Object flag. */
        if(ob->use_holdout) {
-               flag |= SD_HOLDOUT_MASK;
+               flag |= SD_OBJECT_HOLDOUT_MASK;
        }
        state->object_flag[object_index] = flag;
 
@@ -716,9 +716,9 @@ void ObjectManager::apply_static_transforms(DeviceScene *dscene, Scene *scene, u
                                        if(progress.get_cancel()) return;
                                }
 
-                               object_flag[i] |= SD_TRANSFORM_APPLIED;
+                               object_flag[i] |= SD_OBJECT_TRANSFORM_APPLIED;
                                if(object->mesh->transform_negative_scaled)
-                                       object_flag[i] |= SD_NEGATIVE_SCALE_APPLIED;
+                                       object_flag[i] |= SD_OBJECT_NEGATIVE_SCALE_APPLIED;
                        }
                        else
                                have_instancing = true;
index 186a177d9d3919255e4d5793cd088ccb665424b3..d609c739ac70768cf0366446b8bf4ab15943e20b 100644 (file)
@@ -21,9 +21,9 @@
 
 CCL_NAMESPACE_BEGIN
 
-#define CYCLES_VERSION_MAJOR   1
-#define CYCLES_VERSION_MINOR   7
-#define CYCLES_VERSION_PATCH   0
+#define CYCLES_VERSION_MAJOR    1
+#define CYCLES_VERSION_MINOR    8
+#define CYCLES_VERSION_PATCH    1
 
 #define CYCLES_MAKE_VERSION_STRING2(a,b,c) #a "." #b "." #c
 #define CYCLES_MAKE_VERSION_STRING(a,b,c) CYCLES_MAKE_VERSION_STRING2(a,b,c)
index d82d38ac0eb2a157c230e0375688245523986c9d..feea9cf5b13d882c25eb67a59fc2d51a44235aaf 100644 (file)
@@ -277,7 +277,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
                                                {
                                                        FCurve *fcu = ale->data;
                                                        if (show_group_colors && fcu->grp && fcu->grp->customCol) {
-                                                               unsigned char *cp = fcu->grp->cs.active;
+                                                               unsigned char *cp = (unsigned char *)fcu->grp->cs.active;
                                                                
                                                                if (sel) immUniformColor4ub(cp[0], cp[1], cp[2], 0x65);
                                                                else immUniformColor4ub(cp[0], cp[1], cp[2], 0x0B);
index b8ebb375a484d56d3f044243548a57854298401e..bacfc177432a60e515142995f766ba6f0e14134c 100644 (file)
@@ -113,6 +113,10 @@ set(SRC
        intern/MOD_weightvg_util.h
 )
 
+if(WITH_LEGACY_DEPSGRAPH)
+       add_definitions(-DWITH_LEGACY_DEPSGRAPH)
+endif()
+
 if(WITH_ALEMBIC)
        add_definitions(-DWITH_ALEMBIC)
        list(APPEND INC
index d15a6fcb1c8020927600b5f4e58122dc33954da5..ac75b4dbee910a65fd70e92331a89b849cf4041f 100644 (file)
@@ -125,9 +125,15 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
        
        if (clmd) {
                /* Actual code uses get_collisionobjects */
+#ifdef WITH_LEGACY_DEPSGRAPH
                dag_add_collision_relations(forest, scene, ob, obNode, clmd->coll_parms->group, ob->lay|scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
-
                dag_add_forcefield_relations(forest, scene, ob, obNode, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }
 
index bde20e56748e3ee3f93dc403743bda5a4362cec6..b49a407da780346530d491fb233eebcdec3f1476 100644 (file)
@@ -129,6 +129,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 
        /* add relation from canvases to all brush objects */
        if (pmd && pmd->canvas) {
+#ifdef WITH_LEGACY_DEPSGRAPH
                for (DynamicPaintSurface *surface = pmd->canvas->surfaces.first; surface; surface = surface->next) {
                        if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP) {
                                dag_add_forcefield_relations(forest, scene, ob, obNode, surface->effector_weights, true, 0, "Dynamic Paint Field");
@@ -137,6 +138,12 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
                        /* Actual code uses custom loop over group/scene without layer checks in dynamicPaint_doStep */
                        dag_add_collision_relations(forest, scene, ob, obNode, surface->brush_group, -1, eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
                }
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }
 
index f04d7432a8f44da9a33995fa0e6e5007c23e16d1..a7b23ae24036701888c767c26158fd614919633b 100644 (file)
@@ -138,10 +138,16 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 
        if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
                /* Actual code uses get_collisionobjects */
+#ifdef WITH_LEGACY_DEPSGRAPH
                dag_add_collision_relations(forest, scene, ob, obNode, smd->domain->fluid_group, ob->lay|scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
                dag_add_collision_relations(forest, scene, ob, obNode, smd->domain->coll_group, ob->lay|scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
-
                dag_add_forcefield_relations(forest, scene, ob, obNode, smd->domain->effector_weights, true, PFIELD_SMOKEFLOW, "Smoke Force Field");
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }
 
index 17adc7f1520a5cd5cb54a1a660f0733c05519b02..a0bbe5da04ae8f672e6d31e7fe1f203345b9a83e 100644 (file)
@@ -67,10 +67,17 @@ static void updateDepgraph(ModifierData *UNUSED(md), DagForest *forest,
                            Scene *scene, Object *ob, DagNode *obNode)
 {
        if (ob->soft) {
+#ifdef WITH_LEGACY_DEPSGRAPH
                /* Actual code uses ccd_build_deflector_hash */
                dag_add_collision_relations(forest, scene, ob, obNode, ob->soft->collision_group, ob->lay, eModifierType_Collision, NULL, false, "Softbody Collision");
 
                dag_add_forcefield_relations(forest, scene, ob, obNode, ob->soft->effector_weights, true, 0, "Softbody Field");
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }