[Bf-blender-cvs] [b7a27efd781] master: Cleanup: Remove unused subdiv functions

Hans Goudey noreply at git.blender.org
Fri Jan 14 21:04:29 CET 2022


Commit: b7a27efd781b909536ad6f6ade6b7a9d5f746eb9
Author: Hans Goudey
Date:   Fri Jan 14 14:04:24 2022 -0600
Branches: master
https://developer.blender.org/rBb7a27efd781b909536ad6f6ade6b7a9d5f746eb9

Cleanup: Remove unused subdiv functions

I noticed these when doing final cleanup on rBcfa53e0fbeed.
One use was removed in that commit, the others were unused
going further back a few years.

Differential Revision: https://developer.blender.org/D13834

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

M	source/blender/blenkernel/BKE_subdiv_eval.h
M	source/blender/blenkernel/intern/subdiv_eval.c

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

diff --git a/source/blender/blenkernel/BKE_subdiv_eval.h b/source/blender/blenkernel/BKE_subdiv_eval.h
index eeb80898148..2eb64ae795d 100644
--- a/source/blender/blenkernel/BKE_subdiv_eval.h
+++ b/source/blender/blenkernel/BKE_subdiv_eval.h
@@ -102,40 +102,6 @@ void BKE_subdiv_eval_displacement(struct Subdiv *subdiv,
 void BKE_subdiv_eval_final_point(
     struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3]);
 
-/* Patch queries at given resolution.
- *
- * Will evaluate patch at uniformly distributed (u, v) coordinates on a grid
- * of given resolution, producing resolution^2 evaluation points. The order
- * goes as u in rows, v in columns. */
-
-void BKE_subdiv_eval_limit_patch_resolution_point(struct Subdiv *subdiv,
-                                                  int ptex_face_index,
-                                                  int resolution,
-                                                  void *buffer,
-                                                  int offset,
-                                                  int stride);
-void BKE_subdiv_eval_limit_patch_resolution_point_and_derivatives(struct Subdiv *subdiv,
-                                                                  int ptex_face_index,
-                                                                  int resolution,
-                                                                  void *point_buffer,
-                                                                  int point_offset,
-                                                                  int point_stride,
-                                                                  void *du_buffer,
-                                                                  int du_offset,
-                                                                  int du_stride,
-                                                                  void *dv_buffer,
-                                                                  int dv_offset,
-                                                                  int dv_stride);
-void BKE_subdiv_eval_limit_patch_resolution_point_and_normal(struct Subdiv *subdiv,
-                                                             int ptex_face_index,
-                                                             int resolution,
-                                                             void *point_buffer,
-                                                             int point_offset,
-                                                             int point_stride,
-                                                             void *normal_buffer,
-                                                             int normal_offset,
-                                                             int normal_stride);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/intern/subdiv_eval.c b/source/blender/blenkernel/intern/subdiv_eval.c
index b15e18eaa17..c2f7581637b 100644
--- a/source/blender/blenkernel/intern/subdiv_eval.c
+++ b/source/blender/blenkernel/intern/subdiv_eval.c
@@ -337,92 +337,3 @@ void BKE_subdiv_eval_final_point(
     BKE_subdiv_eval_limit_point(subdiv, ptex_face_index, u, v, r_P);
   }
 }
-
-/* ===================  Patch queries at given resolution =================== */
-
-/* Move buffer forward by a given number of bytes. */
-static void buffer_apply_offset(void **buffer, const int offset)
-{
-  *buffer = ((unsigned char *)*buffer) + offset;
-}
-
-/* Write given number of floats to the beginning of given buffer. */
-static void buffer_write_float_value(void **buffer, const float *values_buffer, int num_values)
-{
-  memcpy(*buffer, values_buffer, sizeof(float) * num_values);
-}
-
-void BKE_subdiv_eval_limit_patch_resolution_point(Subdiv *subdiv,
-                                                  const int ptex_face_index,
-                                                  const int resolution,
-                                                  void *buffer,
-                                                  const int offset,
-                                                  const int stride)
-{
-  buffer_apply_offset(&buffer, offset);
-  const float inv_resolution_1 = 1.0f / (float)(resolution - 1);
-  for (int y = 0; y < resolution; y++) {
-    const float v = y * inv_resolution_1;
-    for (int x = 0; x < resolution; x++) {
-      const float u = x * inv_resolution_1;
-      BKE_subdiv_eval_limit_point(subdiv, ptex_face_index, u, v, buffer);
-      buffer_apply_offset(&buffer, stride);
-    }
-  }
-}
-
-void BKE_subdiv_eval_limit_patch_resolution_point_and_derivatives(Subdiv *subdiv,
-                                                                  const int ptex_face_index,
-                                                                  const int resolution,
-                                                                  void *point_buffer,
-                                                                  const int point_offset,
-                                                                  const int point_stride,
-                                                                  void *du_buffer,
-                                                                  const int du_offset,
-                                                                  const int du_stride,
-                                                                  void *dv_buffer,
-                                                                  const int dv_offset,
-                                                                  const int dv_stride)
-{
-  buffer_apply_offset(&point_buffer, point_offset);
-  buffer_apply_offset(&du_buffer, du_offset);
-  buffer_apply_offset(&dv_buffer, dv_offset);
-  const float inv_resolution_1 = 1.0f / (float)(resolution - 1);
-  for (int y = 0; y < resolution; y++) {
-    const float v = y * inv_resolution_1;
-    for (int x = 0; x < resolution; x++) {
-      const float u = x * inv_resolution_1;
-      BKE_subdiv_eval_limit_point_and_derivatives(
-          subdiv, ptex_face_index, u, v, point_buffer, du_buffer, dv_buffer);
-      buffer_apply_offset(&point_buffer, point_stride);
-      buffer_apply_offset(&du_buffer, du_stride);
-      buffer_apply_offset(&dv_buffer, dv_stride);
-    }
-  }
-}
-
-void BKE_subdiv_eval_limit_patch_resolution_point_and_normal(Subdiv *subdiv,
-                                                             const int ptex_face_index,
-                                                             const int resolution,
-                                                             void *point_buffer,
-                                                             const int point_offset,
-                                                             const int point_stride,
-                                                             void *normal_buffer,
-                                                             const int normal_offset,
-                                                             const int normal_stride)
-{
-  buffer_apply_offset(&point_buffer, point_offset);
-  buffer_apply_offset(&normal_buffer, normal_offset);
-  const float inv_resolution_1 = 1.0f / (float)(resolution - 1);
-  for (int y = 0; y < resolution; y++) {
-    const float v = y * inv_resolution_1;
-    for (int x = 0; x < resolution; x++) {
-      const float u = x * inv_resolution_1;
-      float normal[3];
-      BKE_subdiv_eval_limit_point_and_normal(subdiv, ptex_face_index, u, v, point_buffer, normal);
-      buffer_write_float_value(&normal_buffer, normal, 3);
-      buffer_apply_offset(&point_buffer, point_stride);
-      buffer_apply_offset(&normal_buffer, normal_stride);
-    }
-  }
-}



More information about the Bf-blender-cvs mailing list