diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-26 22:25:16 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-26 22:27:16 +0300 |
commit | af87b6d8cb75d9d625378dee25d726a0d55f75c6 (patch) | |
tree | b400a9a7e8d63dc2e60c45e988e969798c066d3b /source/blender/blenkernel/BKE_subdiv_eval.h | |
parent | 42d2c96d4cceab46de8eebf30497e7399a2998e0 (diff) | |
parent | 57dfec79f4ab1ceeb8c5f6049aa03e779e7871c0 (diff) |
Merge branch 'master' into draw-viewport-data
# Conflicts:
# source/blender/draw/DRW_engine_types.h
# source/blender/draw/intern/draw_manager.c
# source/blender/draw/intern/draw_manager.h
# source/blender/draw/intern/draw_manager_profiling.c
# source/blender/draw/intern/draw_manager_text.h
# source/blender/draw/intern/draw_texture_pool.cc
# source/blender/draw/intern/draw_texture_pool.h
# source/blender/draw/intern/draw_view_data.cc
# source/blender/draw/intern/draw_view_data.h
# source/blender/editors/space_view3d/view3d_draw.c
# source/blender/gpu/GPU_texture.h
# source/blender/gpu/GPU_viewport.h
# source/blender/gpu/intern/gpu_shader_create_info_private.hh
# source/blender/gpu/intern/gpu_viewport.c
Diffstat (limited to 'source/blender/blenkernel/BKE_subdiv_eval.h')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv_eval.h | 95 |
1 files changed, 26 insertions, 69 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv_eval.h b/source/blender/blenkernel/BKE_subdiv_eval.h index 0b61e62c89c..23bcdcce276 100644 --- a/source/blender/blenkernel/BKE_subdiv_eval.h +++ b/source/blender/blenkernel/BKE_subdiv_eval.h @@ -30,16 +30,26 @@ extern "C" { #endif struct Mesh; +struct OpenSubdiv_EvaluatorCache; struct Subdiv; +typedef enum eSubdivEvaluatorType { + SUBDIV_EVALUATOR_TYPE_CPU, + SUBDIV_EVALUATOR_TYPE_GLSL_COMPUTE, +} eSubdivEvaluatorType; + /* Returns true if evaluator is ready for use. */ -bool BKE_subdiv_eval_begin(struct Subdiv *subdiv); +bool BKE_subdiv_eval_begin(struct Subdiv *subdiv, + eSubdivEvaluatorType evaluator_type, + struct OpenSubdiv_EvaluatorCache *evaluator_cache); /* coarse_vertex_cos is an optional argument which allows to override coordinates of the coarse * mesh. */ bool BKE_subdiv_eval_begin_from_mesh(struct Subdiv *subdiv, const struct Mesh *mesh, - const float (*coarse_vertex_cos)[3]); + const float (*coarse_vertex_cos)[3], + eSubdivEvaluatorType evaluator_type, + struct OpenSubdiv_EvaluatorCache *evaluator_cache); bool BKE_subdiv_eval_refine_from_mesh(struct Subdiv *subdiv, const struct Mesh *mesh, const float (*coarse_vertex_cos)[3]); @@ -55,33 +65,23 @@ void BKE_subdiv_eval_init_displacement(struct Subdiv *subdiv); /* Evaluate point at a limit surface, with optional derivatives and normal. */ void BKE_subdiv_eval_limit_point( - struct Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3]); + struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3]); void BKE_subdiv_eval_limit_point_and_derivatives(struct Subdiv *subdiv, - const int ptex_face_index, - const float u, - const float v, + int ptex_face_index, + float u, + float v, float r_P[3], float r_dPdu[3], float r_dPdv[3]); -void BKE_subdiv_eval_limit_point_and_normal(struct Subdiv *subdiv, - const int ptex_face_index, - const float u, - const float v, - float r_P[3], - float r_N[3]); -void BKE_subdiv_eval_limit_point_and_short_normal(struct Subdiv *subdiv, - const int ptex_face_index, - const float u, - const float v, - float r_P[3], - short r_N[3]); +void BKE_subdiv_eval_limit_point_and_normal( + struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3], float r_N[3]); /* Evaluate face-varying layer (such as UV). */ void BKE_subdiv_eval_face_varying(struct Subdiv *subdiv, - const int face_varying_channel, - const int ptex_face_index, - const float u, - const float v, + int face_varying_channel, + int ptex_face_index, + float u, + float v, float r_face_varying[2]); /* NOTE: Expects derivatives to be correct. @@ -91,59 +91,16 @@ void BKE_subdiv_eval_face_varying(struct Subdiv *subdiv, * Would be nice to have displacement evaluation function which does not require * knowing derivatives ahead of a time. */ void BKE_subdiv_eval_displacement(struct Subdiv *subdiv, - const int ptex_face_index, - const float u, - const float v, + int ptex_face_index, + float u, + float v, const float dPdu[3], const float dPdv[3], float r_D[3]); /* Evaluate point on a limit surface with displacement applied to it. */ void BKE_subdiv_eval_final_point( - struct Subdiv *subdiv, const int ptex_face_index, const float u, const 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, - const int ptex_face_index, - const int resolution, - void *buffer, - const int offset, - const int stride); -void BKE_subdiv_eval_limit_patch_resolution_point_and_derivatives(struct 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); -void BKE_subdiv_eval_limit_patch_resolution_point_and_normal(struct 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); -void BKE_subdiv_eval_limit_patch_resolution_point_and_short_normal(struct 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); + struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3]); #ifdef __cplusplus } |