diff options
author | Hans Goudey <h.goudey@me.com> | 2022-01-14 23:04:24 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-01-14 23:04:24 +0300 |
commit | b7a27efd781b909536ad6f6ade6b7a9d5f746eb9 (patch) | |
tree | 5aae45dd02cea81c1283aff1fbe5bbf1a025865e /source/blender/blenkernel/intern/subdiv_eval.c | |
parent | bba95d1901a8d0ed4d2797e87e7a2dc756589b32 (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_eval.c')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_eval.c | 89 |
1 files changed, 0 insertions, 89 deletions
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); - } - } -} |