[Bf-blender-cvs] [e89d42ddffe] master: Cleanup: move public doc-strings into headers for 'draw'

Campbell Barton noreply at git.blender.org
Wed Dec 8 11:05:40 CET 2021


Commit: e89d42ddffef8892a8eb52d29e2a7329ad381204
Author: Campbell Barton
Date:   Wed Dec 8 20:29:39 2021 +1100
Branches: master
https://developer.blender.org/rBe89d42ddffef8892a8eb52d29e2a7329ad381204

Cleanup: move public doc-strings into headers for 'draw'

Ref T92709

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

M	source/blender/draw/DRW_engine.h
M	source/blender/draw/DRW_select_buffer.h
M	source/blender/draw/engines/eevee/eevee_cryptomatte.c
M	source/blender/draw/engines/eevee/eevee_effects.c
M	source/blender/draw/engines/eevee/eevee_lightcache.c
M	source/blender/draw/engines/eevee/eevee_lightcache.h
M	source/blender/draw/engines/eevee/eevee_lightprobes.c
M	source/blender/draw/engines/eevee/eevee_lights.c
M	source/blender/draw/engines/eevee/eevee_materials.c
M	source/blender/draw/engines/eevee/eevee_private.h
M	source/blender/draw/engines/eevee/eevee_render.c
M	source/blender/draw/engines/eevee/eevee_renderpasses.c
M	source/blender/draw/engines/eevee/eevee_sampling.c
M	source/blender/draw/engines/eevee/eevee_shaders.c
M	source/blender/draw/engines/eevee/eevee_shadows.c
M	source/blender/draw/engines/eevee/eevee_shadows_cube.c
M	source/blender/draw/engines/eevee/eevee_temporal_sampling.c
M	source/blender/draw/engines/gpencil/gpencil_draw_data.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h
M	source/blender/draw/engines/gpencil/gpencil_render.c
M	source/blender/draw/engines/overlay/overlay_armature.c
M	source/blender/draw/engines/overlay/overlay_image.c
M	source/blender/draw/engines/overlay/overlay_private.h
M	source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
M	source/blender/draw/engines/workbench/workbench_engine.c
M	source/blender/draw/engines/workbench/workbench_materials.c
M	source/blender/draw/engines/workbench/workbench_private.h
M	source/blender/draw/engines/workbench/workbench_transparent.c
M	source/blender/draw/intern/DRW_render.h
M	source/blender/draw/intern/draw_cache.c
M	source/blender/draw/intern/draw_cache.h
M	source/blender/draw/intern/draw_cache_extract_mesh_render_data.c
M	source/blender/draw/intern/draw_cache_impl.h
M	source/blender/draw/intern/draw_cache_impl_gpencil.c
M	source/blender/draw/intern/draw_cache_impl_hair.c
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/draw/intern/draw_cache_impl_particles.c
M	source/blender/draw/intern/draw_color_management.cc
M	source/blender/draw/intern/draw_color_management.h
M	source/blender/draw/intern/draw_common.c
M	source/blender/draw/intern/draw_common.h
M	source/blender/draw/intern/draw_debug.c
M	source/blender/draw/intern/draw_debug.h
M	source/blender/draw/intern/draw_fluid.c
M	source/blender/draw/intern/draw_hair.c
M	source/blender/draw/intern/draw_hair_private.h
M	source/blender/draw/intern/draw_instance_data.c
M	source/blender/draw/intern/draw_instance_data.h
M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/intern/draw_manager_data.c
M	source/blender/draw/intern/draw_manager_exec.c
M	source/blender/draw/intern/draw_manager_profiling.c
M	source/blender/draw/intern/draw_manager_profiling.h
M	source/blender/draw/intern/draw_manager_shader.c
M	source/blender/draw/intern/draw_manager_text.c
M	source/blender/draw/intern/draw_manager_text.h
M	source/blender/draw/intern/draw_select_buffer.c
M	source/blender/draw/intern/draw_texture_pool.cc
M	source/blender/draw/intern/draw_texture_pool.h
M	source/blender/draw/intern/draw_view.c
M	source/blender/draw/intern/draw_view_data.cc
M	source/blender/draw/intern/draw_view_data.h
M	source/blender/draw/intern/mesh_extractors/extract_mesh.h

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

diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index af6c8ea62b2..98e166ac3a7 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -75,9 +75,21 @@ typedef enum eDRWSelectStage {
 typedef bool (*DRW_SelectPassFn)(eDRWSelectStage stage, void *user_data);
 typedef bool (*DRW_ObjectFilterFn)(struct Object *ob, void *user_data);
 
+/**
+ * Everything starts here.
+ * This function takes care of calling all cache and rendering functions
+ * for each relevant engine / mode engine.
+ */
 void DRW_draw_view(const struct bContext *C);
+/**
+ * Draw render engine info.
+ */
 void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height);
 
+/**
+ * Used for both regular and off-screen drawing.
+ * Need to reset DST before calling this function
+ */
 void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph,
                              struct RenderEngineType *engine_type,
                              struct ARegion *region,
@@ -88,6 +100,9 @@ void DRW_draw_render_loop(struct Depsgraph *depsgraph,
                           struct ARegion *region,
                           struct View3D *v3d,
                           struct GPUViewport *viewport);
+/**
+ * \param viewport: can be NULL, in this case we create one.
+ */
 void DRW_draw_render_loop_offscreen(struct Depsgraph *depsgraph,
                                     struct RenderEngineType *engine_type,
                                     struct ARegion *region,
@@ -101,6 +116,9 @@ void DRW_draw_render_loop_2d_ex(struct Depsgraph *depsgraph,
                                 struct ARegion *region,
                                 struct GPUViewport *viewport,
                                 const struct bContext *evil_C);
+/**
+ * object mode select-loop, see: #ED_view3d_draw_select_loop (legacy drawing).
+ */
 void DRW_draw_select_loop(struct Depsgraph *depsgraph,
                           struct ARegion *region,
                           struct View3D *v3d,
@@ -113,14 +131,23 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph,
                           void *select_pass_user_data,
                           DRW_ObjectFilterFn object_filter_fn,
                           void *object_filter_user_data);
+/**
+ * object mode select-loop, see: #ED_view3d_draw_depth_loop (legacy drawing).
+ */
 void DRW_draw_depth_loop(struct Depsgraph *depsgraph,
                          struct ARegion *region,
                          struct View3D *v3d,
                          struct GPUViewport *viewport);
+/**
+ * Converted from #ED_view3d_draw_depth_gpencil (legacy drawing).
+ */
 void DRW_draw_depth_loop_gpencil(struct Depsgraph *depsgraph,
                                  struct ARegion *region,
                                  struct View3D *v3d,
                                  struct GPUViewport *viewport);
+/**
+ * Clears the Depth Buffer and draws only the specified object.
+ */
 void DRW_draw_depth_object(struct Scene *scene,
                            struct ARegion *region,
                            struct View3D *v3d,
@@ -131,11 +158,17 @@ void DRW_draw_select_id(struct Depsgraph *depsgraph,
                         struct View3D *v3d,
                         const struct rcti *rect);
 
-/* grease pencil render */
+/* Grease pencil render. */
+
+/**
+ * Helper to check if exit object type to render.
+ */
 bool DRW_render_check_grease_pencil(struct Depsgraph *depsgraph);
 void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph);
 
-/* This is here because GPUViewport needs it */
+/**
+ * This is here because #GPUViewport needs it.
+ */
 struct DRWInstanceDataList *DRW_instance_data_list_create(void);
 void DRW_instance_data_list_free(struct DRWInstanceDataList *idatalist);
 void DRW_uniform_attrs_pool_free(struct GHash *table);
@@ -165,11 +198,21 @@ void DRW_opengl_context_disable_ex(bool restore);
 
 void DRW_opengl_render_context_enable(void *re_gl_context);
 void DRW_opengl_render_context_disable(void *re_gl_context);
+/**
+ * Needs to be called AFTER #DRW_opengl_render_context_enable().
+ */
 void DRW_gpu_render_context_enable(void *re_gpu_context);
+/**
+ * Needs to be called BEFORE #DRW_opengl_render_context_disable().
+ */
 void DRW_gpu_render_context_disable(void *re_gpu_context);
 
 void DRW_deferred_shader_remove(struct GPUMaterial *mat);
 
+/**
+ * Get DrawData from the given ID-block. In order for this to work, we assume that
+ * the DrawData pointer is stored in the struct in the same fashion as in #IdDdtTemplate.
+ */
 struct DrawDataList *DRW_drawdatalist_from_id(struct ID *id);
 void DRW_drawdata_free(struct ID *id);
 
@@ -179,7 +222,10 @@ void DRW_viewport_data_free(struct DRWData *drw_data);
 bool DRW_opengl_context_release(void);
 void DRW_opengl_context_activate(bool drw_state);
 
-/* We may want to move this into a more general location. */
+/**
+ * We may want to move this into a more general location.
+ * \note This doesn't require the draw context to be in use.
+ */
 void DRW_draw_cursor_2d_ex(const struct ARegion *region, const float cursor[2]);
 
 #ifdef __cplusplus
diff --git a/source/blender/draw/DRW_select_buffer.h b/source/blender/draw/DRW_select_buffer.h
index 43d4005c3a9..18134558af8 100644
--- a/source/blender/draw/DRW_select_buffer.h
+++ b/source/blender/draw/DRW_select_buffer.h
@@ -81,6 +81,7 @@ typedef struct SELECTID_Context {
 } SELECTID_Context;
 
 /* draw_select_buffer.c */
+
 bool DRW_select_buffer_elem_get(const uint sel_id,
                                 uint *r_elem,
                                 uint *r_base_index,
@@ -88,22 +89,41 @@ bool DRW_select_buffer_elem_get(const uint sel_id,
 uint DRW_select_buffer_context_offset_for_object_elem(struct Depsgraph *depsgraph,
                                                       struct Object *object,
                                                       char elem_type);
+/**
+ * Main function to read a block of pixels from the select frame buffer.
+ */
 uint *DRW_select_buffer_read(struct Depsgraph *depsgraph,
                              struct ARegion *region,
                              struct View3D *v3d,
                              const rcti *rect,
                              uint *r_buf_len);
+/**
+ * \param rect: The rectangle to sample indices from (min/max inclusive).
+ * \returns a #BLI_bitmap the length of \a bitmap_len or NULL on failure.
+ */
 uint *DRW_select_buffer_bitmap_from_rect(struct Depsgraph *depsgraph,
                                          struct ARegion *region,
                                          struct View3D *v3d,
                                          const struct rcti *rect,
                                          uint *r_bitmap_len);
+/**
+ * \param center: Circle center.
+ * \param radius: Circle radius.
+ * \param r_bitmap_len: Number of indices in the selection id buffer.
+ * \returns a #BLI_bitmap the length of \a r_bitmap_len or NULL on failure.
+ */
 uint *DRW_select_buffer_bitmap_from_circle(struct Depsgraph *depsgraph,
                                            struct ARegion *region,
                                            struct View3D *v3d,
                                            const int center[2],
                                            const int radius,
                                            uint *r_bitmap_len);
+/**
+ * \param poly: The polygon coordinates.
+ * \param poly_len: Length of the polygon.
+ * \param rect: Polygon boundaries.
+ * \returns a #BLI_bitmap.
+ */
 uint *DRW_select_buffer_bitmap_from_poly(struct Depsgraph *depsgraph,
                                          struct ARegion *region,
                                          struct View3D *v3d,
@@ -111,10 +131,18 @@ uint *DRW_select_buffer_bitmap_from_poly(struct Depsgraph *depsgraph,
                                          const int poly_len,
                                          const struct rcti *rect,
                                          uint *r_bitmap_len);
+/**
+ * Samples a single pixel.
+ */
 uint DRW_select_buffer_sample_point(struct Depsgraph *depsgraph,
                                     struct ARegion *region,
                                     struct View3D *v3d,
                                     const int center[2]);
+/**
+ * Find the selection id closest to \a center.
+ * \param dist: Use to initialize the distance,
+ * when found, this value is set to the distance of the selection that's returned.
+ */
 uint DRW_select_buffer_find_nearest_to_point(struct Depsgraph *depsgraph,
                                              struct ARegion *region,
                                              struct View3D *v3d,
diff --git a/source/blender/draw/engines/eevee/eevee_cryptomatte.c b/source/blender/draw/engines/eevee/eevee_cryptomatte.c
index 1b8e967e38f..80207523a65 100644
--- a/source/blender/draw/engines/eevee/eevee_cryptomatte.c
+++ b/source/blender/draw/engines/eevee/eevee_cryptomatte.c
@@ -435,9 +435,6 @@ void EEVEE_cryptomatte_output_accumulate(EEVEE_ViewLayerData *UNUSED(sldata), EE
 /** \name Update Render Passes
  * \{ */
 
-/* Register the render passes needed for cryptomatte
- * normally this is done in `EEVEE_render_update_passes`, but it has been placed here to keep
- * related code side-by-side for clarity. */
 void EEVEE_cryptomatte_update_passes(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
 {
   char cryptomatte_pass_name[MAX_NAME];
diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c
index c2f3e3a6d95..3d32b4acd82 100644
--- a/source/blender/draw/engines/eevee/eevee_effects.c
+++ b/source/blender/draw/engines/eevee/eevee_effects.c
@@ -411,9 +411,6 @@ static void downsample_radiance_cb(void *vedata, int level)
   DRW_draw_pass(psl->color_downsample_ps);
 }
 
-/**
- * Simple down-sampling algorithm. Reconstruct mip chain up to mip level.
- */
 void EEVEE_effects_downsample_radiance_buffer(EEVEE_Data *vedata, GPUTexture *texture_src)
 {
   EEVEE_PassList *psl = vedata->psl;
@@ -430,9 +427,6 @@ void EEVEE_effects_downsample_radiance_buffer(EEVEE_Data *vedata, GPUTexture *te
   DRW_stats_group_end();
 }
 
-/**
- 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list