[Bf-blender-cvs] [3b48097ae99] cycles_procedural_api: cleanup, revert unnecessary changes from master

Kévin Dietrich noreply at git.blender.org
Fri Oct 9 17:56:05 CEST 2020


Commit: 3b48097ae9994cd2d351c44517759c0a417377a4
Author: Kévin Dietrich
Date:   Fri Oct 9 01:23:27 2020 +0200
Branches: cycles_procedural_api
https://developer.blender.org/rB3b48097ae9994cd2d351c44517759c0a417377a4

cleanup, revert unnecessary changes from master

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

M	intern/cycles/render/geometry.h
M	intern/cycles/render/mesh_subdivision.cpp
M	intern/cycles/render/object.cpp
M	intern/cycles/render/object.h
M	intern/cycles/subd/subd_split.cpp
M	intern/cycles/subd/subd_split.h

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

diff --git a/intern/cycles/render/geometry.h b/intern/cycles/render/geometry.h
index 95495e9cbdf..d749566760a 100644
--- a/intern/cycles/render/geometry.h
+++ b/intern/cycles/render/geometry.h
@@ -56,31 +56,27 @@ class Geometry : public Node {
     VOLUME,
   };
 
-  /* Maximum number of motion steps supported (due to Embree). */
-  static const uint MAX_MOTION_STEPS = 129;
-
-  /* Motion Blur */
-  NODE_PUBLIC_API(uint, motion_steps)
-  NODE_PUBLIC_API(bool, use_motion_blur)
+  Type geometry_type;
 
   /* Attributes */
-  AttributeSet attributes;  // @api
+  AttributeSet attributes;
 
   /* Shaders */
   NODE_PUBLIC_API_ARRAY(array<Node *>, used_shaders)
 
-  /* Update Flags */
-  bool need_update_rebuild;
-
-  bool transform_applied;
-
-  Type geometry_type;  // should not be public as it is read-only after creation
-
   /* Transform */
   BoundBox bounds;
+  bool transform_applied;
   bool transform_negative_scaled;
   Transform transform_normal;
 
+  /* Motion Blur */
+  NODE_PUBLIC_API(uint, motion_steps)
+  NODE_PUBLIC_API(bool, use_motion_blur)
+
+  /* Maximum number of motion steps supported (due to Embree). */
+  static const uint MAX_MOTION_STEPS = 129;
+
   /* BVH */
   BVH *bvh;
   size_t attr_map_offset;
@@ -91,7 +87,9 @@ class Geometry : public Node {
   bool has_volume;         /* Set in the device_update_flags(). */
   bool has_surface_bssrdf; /* Set in the device_update_flags(). */
 
- public:
+  /* Update Flags */
+  bool need_update_rebuild;
+
   /* Constructor/Destructor */
   explicit Geometry(const NodeType *node_type, const Type type);
   virtual ~Geometry();
diff --git a/intern/cycles/render/mesh_subdivision.cpp b/intern/cycles/render/mesh_subdivision.cpp
index 2c2f3e3f6b9..40c9f03a853 100644
--- a/intern/cycles/render/mesh_subdivision.cpp
+++ b/intern/cycles/render/mesh_subdivision.cpp
@@ -44,7 +44,7 @@ namespace OPENSUBDIV_VERSION {
 namespace Far {
 template<>
 bool TopologyRefinerFactory<ccl::Mesh>::resizeComponentTopology(TopologyRefiner &refiner,
-                                                                const ccl::Mesh &mesh)
+                                                                ccl::Mesh const &mesh)
 {
   setNumBaseVertices(refiner, mesh.get_verts().size());
   setNumBaseFaces(refiner, mesh.get_num_subd_faces());
@@ -58,7 +58,7 @@ bool TopologyRefinerFactory<ccl::Mesh>::resizeComponentTopology(TopologyRefiner
 
 template<>
 bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTopology(TopologyRefiner &refiner,
-                                                                const ccl::Mesh &mesh)
+                                                                ccl::Mesh const &mesh)
 {
   const ccl::array<int> &subd_face_corners = mesh.get_subd_face_corners();
   const ccl::array<int> &subd_start_corner = mesh.get_subd_start_corner();
@@ -80,7 +80,7 @@ bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTopology(TopologyRefiner
 
 template<>
 bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTags(TopologyRefiner &refiner,
-                                                            const ccl::Mesh &mesh)
+                                                            ccl::Mesh const &mesh)
 {
   size_t num_creases = mesh.get_subd_creases_weight().size();
 
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index d02d3e73ee3..3a314437f0b 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -373,9 +373,9 @@ ObjectManager::~ObjectManager()
 {
 }
 
-float ObjectManager::object_surface_area(UpdateObjectTransformState *state,
-                                         const Transform &tfm,
-                                         Geometry *geom)
+static float object_surface_area(UpdateObjectTransformState *state,
+                                 const Transform &tfm,
+                                 Geometry *geom)
 {
   if (geom->geometry_type != Geometry::MESH && geom->geometry_type != Geometry::VOLUME) {
     return 0.0f;
diff --git a/intern/cycles/render/object.h b/intern/cycles/render/object.h
index 0131fe1b6a0..c138848054b 100644
--- a/intern/cycles/render/object.h
+++ b/intern/cycles/render/object.h
@@ -149,11 +149,6 @@ class ObjectManager {
   bool device_update_object_transform_pop_work(UpdateObjectTransformState *state,
                                                int *start_index,
                                                int *num_objects);
-
- private:
-  static float object_surface_area(UpdateObjectTransformState *state,
-                                   const Transform &tfm,
-                                   Geometry *geom);
 };
 
 CCL_NAMESPACE_END
diff --git a/intern/cycles/subd/subd_split.cpp b/intern/cycles/subd/subd_split.cpp
index 437a5bb680d..928f5bf2ed7 100644
--- a/intern/cycles/subd/subd_split.cpp
+++ b/intern/cycles/subd/subd_split.cpp
@@ -364,16 +364,16 @@ void DiagSplit::split_patches(Patch *patches, size_t patches_byte_stride)
   post_split();
 }
 
-Edge *DiagSplit::create_edge_from_corner(DiagSplit *split,
-                                         const Mesh *mesh,
-                                         const Mesh::SubdFace &face,
-                                         int corner,
-                                         bool &reversed,
-                                         int v0,
-                                         int v1)
+static Edge *create_edge_from_corner(DiagSplit *split,
+                                     const Mesh *mesh,
+                                     const Mesh::SubdFace &face,
+                                     int corner,
+                                     bool &reversed,
+                                     int v0,
+                                     int v1)
 {
-  int a = mesh->subd_face_corners[face.start_corner + mod(corner + 0, face.num_corners)];
-  int b = mesh->subd_face_corners[face.start_corner + mod(corner + 1, face.num_corners)];
+  int a = mesh->get_subd_face_corners()[face.start_corner + mod(corner + 0, face.num_corners)];
+  int b = mesh->get_subd_face_corners()[face.start_corner + mod(corner + 1, face.num_corners)];
 
   reversed = !(b < a);
 
@@ -431,20 +431,20 @@ void DiagSplit::split_quad(const Mesh::SubdFace &face, Patch *patch)
   split(subpatch, -2);
 }
 
-Edge *DiagSplit::create_split_edge_from_corner(DiagSplit *split,
-                                               const Mesh *mesh,
-                                               const Mesh::SubdFace &face,
-                                               int corner,
-                                               int side,
-                                               bool &reversed,
-                                               int v0,
-                                               int v1,
-                                               int vc)
+static Edge *create_split_edge_from_corner(DiagSplit *split,
+                                           const Mesh *mesh,
+                                           const Mesh::SubdFace &face,
+                                           int corner,
+                                           int side,
+                                           bool &reversed,
+                                           int v0,
+                                           int v1,
+                                           int vc)
 {
   Edge *edge = split->alloc_edge();
 
-  int a = mesh->subd_face_corners[face.start_corner + mod(corner + 0, face.num_corners)];
-  int b = mesh->subd_face_corners[face.start_corner + mod(corner + 1, face.num_corners)];
+  int a = mesh->get_subd_face_corners()[face.start_corner + mod(corner + 0, face.num_corners)];
+  int b = mesh->get_subd_face_corners()[face.start_corner + mod(corner + 1, face.num_corners)];
 
   if (b < a) {
     edge->stitch_edge_key = {b, a};
diff --git a/intern/cycles/subd/subd_split.h b/intern/cycles/subd/subd_split.h
index f950eb61f78..773f4ddf120 100644
--- a/intern/cycles/subd/subd_split.h
+++ b/intern/cycles/subd/subd_split.h
@@ -68,25 +68,6 @@ class DiagSplit {
   void split_ngon(const Mesh::SubdFace &face, Patch *patches, size_t patches_byte_stride);
 
   void post_split();
-
- private:
-  static Edge *create_edge_from_corner(DiagSplit *split,
-                                       const Mesh *mesh,
-                                       const Mesh::SubdFace &face,
-                                       int corner,
-                                       bool &reversed,
-                                       int v0,
-                                       int v1);
-
-  static Edge *create_split_edge_from_corner(DiagSplit *split,
-                                             const Mesh *mesh,
-                                             const Mesh::SubdFace &face,
-                                             int corner,
-                                             int side,
-                                             bool &reversed,
-                                             int v0,
-                                             int v1,
-                                             int vc);
 };
 
 CCL_NAMESPACE_END



More information about the Bf-blender-cvs mailing list