diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-05 03:10:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-05 03:10:25 +0300 |
commit | 2b66b372bc39e12f938488a008f38b1945d86aa9 (patch) | |
tree | d8f2409d99bd91d8998c129f76fd4dc82a2a91d5 /source/blender/gpu | |
parent | 2dace5f3ef54cc25ed31fe20fd33df727f10a9ac (diff) |
Cleanup: use doxygen sections
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_select.c | 30 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_select_pick.c | 42 |
2 files changed, 51 insertions, 21 deletions
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c index 661c462f60d..3c89f082e9b 100644 --- a/source/blender/gpu/intern/gpu_select.c +++ b/source/blender/gpu/intern/gpu_select.c @@ -38,6 +38,10 @@ #include "gpu_select_private.h" +/* -------------------------------------------------------------------- */ +/** \name Internal Types + * \{ */ + /* Internal algorithm used */ enum { /** glBegin/EndQuery(GL_SAMPLES_PASSED... ), `gpu_select_query.c` @@ -61,6 +65,12 @@ typedef struct GPUSelectState { static GPUSelectState g_select_state = {0}; +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Public API + * \{ */ + /** * initialize and provide buffer for results */ @@ -149,12 +159,14 @@ uint GPU_select_end(void) return hits; } -/* ---------------------------------------------------------------------------- - * Caching +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Caching * * Support multiple begin/end's as long as they are within the initial region. - * Currently only used by ALGO_GL_PICK. - */ + * Currently only used by #ALGO_GL_PICK. + * \{ */ void GPU_select_cache_begin(void) { @@ -187,9 +199,11 @@ bool GPU_select_is_cached(void) return g_select_state.use_cache && gpu_select_pick_is_cached(); } -/* ---------------------------------------------------------------------------- - * Utilities - */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Utilities + * \{ */ /** * Helper function, nothing special but avoids doing inline since hits aren't sorted by depth @@ -269,3 +283,5 @@ void GPU_select_buffer_stride_realign(const rcti *src, const rcti *dst, uint *r_ } memset(r_buf, 0, (last_px_id + 1) * sizeof(*r_buf)); } + +/** \} */ diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c index 7fb704c29dd..a8907859bf4 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -51,9 +51,9 @@ /* Z-depth of cleared depth buffer */ #define DEPTH_MAX 0xffffffff -/* ---------------------------------------------------------------------------- - * SubRectStride - */ +/* -------------------------------------------------------------------- */ +/** \name #SubRectStride + * \{ */ /* For looping over a sub-region of a rect, could be moved into 'rct.c'. */ typedef struct SubRectStride { @@ -99,14 +99,16 @@ BLI_INLINE bool depth_is_filled(const depth_t *prev, const depth_t *curr) return (*prev != *curr) && (*curr != DEPTH_MAX); } -/* ---------------------------------------------------------------------------- - * DepthBufCache +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name #DepthBufCache * - * Result of reading glReadPixels, + * Result of reading #glReadPixels, * use for both cache and non-cached storage. - */ + * \{ */ -/* store result of glReadPixels */ +/** Store result of #glReadPixels. */ typedef struct DepthBufCache { struct DepthBufCache *next, *prev; uint id; @@ -188,11 +190,13 @@ static bool depth_buf_subrect_depth_any_filled(const DepthBufCache *rect_src, return false; } -/* ---------------------------------------------------------------------------- - * DepthID +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name #DepthID * * Internal structure for storing hits. - */ + * \{ */ typedef struct DepthID { uint id; @@ -225,6 +229,12 @@ static int depth_cmp(const void *v1, const void *v2) return 0; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Main Selection Begin/End/Load API + * \{ */ + /* depth sorting */ typedef struct GPUPickState { /* cache on initialization */ @@ -691,11 +701,13 @@ uint gpu_select_pick_end(void) return hits; } -/* ---------------------------------------------------------------------------- - * Caching +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Caching * * Support multiple begin/end's reusing depth buffers. - */ + * \{ */ void gpu_select_pick_cache_begin(void) { @@ -749,3 +761,5 @@ void gpu_select_pick_cache_load_id(void) } } } + +/** \} */ |