[Bf-blender-cvs] [41866070d31] master: Cleanup: remove unused flag

Brecht Van Lommel noreply at git.blender.org
Thu Jun 4 14:44:46 CEST 2020


Commit: 41866070d3154dcdfc7ff38b6c472f2f6b591c13
Author: Brecht Van Lommel
Date:   Sat Feb 8 23:19:59 2020 +0100
Branches: master
https://developer.blender.org/rB41866070d3154dcdfc7ff38b6c472f2f6b591c13

Cleanup: remove unused flag

===================================================================

M	intern/cycles/bvh/bvh.cpp
M	intern/cycles/bvh/bvh8.cpp
M	intern/cycles/bvh/bvh_build.cpp
M	intern/cycles/kernel/kernel_types.h

===================================================================

diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index e6502a40313..0313bcd68b0 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -229,8 +229,6 @@ void BVH::refit_primitives(int start, int end, BoundBox &bbox, uint &visibility)
 
         curve.bounds_grow(k, &hair->curve_keys[0], &hair->curve_radius[0], bbox);
 
-        visibility |= PATH_RAY_CURVE;
-
         /* Motion curves. */
         if (hair->use_motion_blur) {
           Attribute *attr = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
@@ -327,9 +325,6 @@ void BVH::pack_primitives()
         pack.prim_tri_index[i] = -1;
       }
       pack.prim_visibility[i] = ob->visibility_for_tracing();
-      if (pack.prim_type[i] & PRIMITIVE_ALL_CURVE) {
-        pack.prim_visibility[i] |= PATH_RAY_CURVE;
-      }
     }
     else {
       pack.prim_tri_index[i] = -1;
diff --git a/intern/cycles/bvh/bvh8.cpp b/intern/cycles/bvh/bvh8.cpp
index 342dd9e85a5..b805865b2c8 100644
--- a/intern/cycles/bvh/bvh8.cpp
+++ b/intern/cycles/bvh/bvh8.cpp
@@ -439,8 +439,6 @@ void BVH8::refit_node(int idx, bool leaf, BoundBox &bbox, uint &visibility)
 
           curve.bounds_grow(k, &hair->curve_keys[0], &hair->curve_radius[0], bbox);
 
-          visibility |= PATH_RAY_CURVE;
-
           /* Motion curves. */
           if (hair->use_motion_blur) {
             Attribute *attr = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index db156219f09..814b5ced5d2 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -885,9 +885,6 @@ BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector<BVHRefer
 
       bounds[type_index].grow(ref.bounds());
       visibility[type_index] |= objects[ref.prim_object()]->visibility_for_tracing();
-      if (ref.prim_type() & PRIMITIVE_ALL_CURVE) {
-        visibility[type_index] |= PATH_RAY_CURVE;
-      }
       ++num_new_prims;
     }
     else {
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 630d00a4e71..0a0cf1bd6c0 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -273,6 +273,7 @@ enum SamplingPattern {
 /* these flags values correspond to raytypes in osl.cpp, so keep them in sync! */
 
 enum PathRayFlag {
+  /* Ray visibility. */
   PATH_RAY_CAMERA = (1 << 0),
   PATH_RAY_REFLECT = (1 << 1),
   PATH_RAY_TRANSMIT = (1 << 2),
@@ -281,6 +282,7 @@ enum PathRayFlag {
   PATH_RAY_SINGULAR = (1 << 5),
   PATH_RAY_TRANSPARENT = (1 << 6),
 
+  /* Shadow ray visibility. */
   PATH_RAY_SHADOW_OPAQUE_NON_CATCHER = (1 << 7),
   PATH_RAY_SHADOW_OPAQUE_CATCHER = (1 << 8),
   PATH_RAY_SHADOW_OPAQUE = (PATH_RAY_SHADOW_OPAQUE_NON_CATCHER | PATH_RAY_SHADOW_OPAQUE_CATCHER),
@@ -292,8 +294,11 @@ enum PathRayFlag {
                                  PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER),
   PATH_RAY_SHADOW = (PATH_RAY_SHADOW_OPAQUE | PATH_RAY_SHADOW_TRANSPARENT),
 
-  PATH_RAY_CURVE = (1 << 11),          /* visibility flag to define curve segments */
-  PATH_RAY_VOLUME_SCATTER = (1 << 12), /* volume scattering */
+  /* Unused, free to reuse. */
+  PATH_RAY_UNUSED = (1 << 11),
+
+  /* Ray visibility for volume scattering. */
+  PATH_RAY_VOLUME_SCATTER = (1 << 12),
 
   /* Special flag to tag unaligned BVH nodes. */
   PATH_RAY_NODE_UNALIGNED = (1 << 13),



More information about the Bf-blender-cvs mailing list