Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/cache.c')
-rw-r--r--source/blender/imbuf/intern/cache.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/cache.c b/source/blender/imbuf/intern/cache.c
index 23ce9bd7818..02d1fe3710a 100644
--- a/source/blender/imbuf/intern/cache.c
+++ b/source/blender/imbuf/intern/cache.c
@@ -32,6 +32,10 @@
#include "imbuf.h"
+/* -------------------------------------------------------------------- */
+/** \name Local Structs
+ * \{ */
+
/* We use a two level cache here. A per-thread cache with limited number of
* tiles. This can be accessed without locking and so is hoped to lead to most
* tile access being lock-free. The global cache is shared between all threads
@@ -85,7 +89,11 @@ typedef struct ImGlobalTileCache {
static ImGlobalTileCache GLOBAL_CACHE;
-/***************************** Hash Functions ********************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Hash Functions
+ * \{ */
static unsigned int imb_global_tile_hash(const void *gtile_p)
{
@@ -117,7 +125,11 @@ static bool imb_thread_tile_cmp(const void *a_p, const void *b_p)
return ((a->ibuf != b->ibuf) || (a->tx != b->tx) || (a->ty != b->ty));
}
-/******************************** Load/Unload ********************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Load/Unload
+ * \{ */
static void imb_global_cache_tile_load(ImGlobalTile *gtile)
{
@@ -167,7 +179,11 @@ void imb_tile_cache_tile_free(ImBuf *ibuf, int tx, int ty)
BLI_mutex_unlock(&GLOBAL_CACHE.mutex);
}
-/******************************* Init/Exit ***********************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Init/Exit
+ * \{ */
static void imb_thread_cache_init(ImThreadTileCache *cache)
{
@@ -265,7 +281,11 @@ void IMB_tile_cache_params(int totthread, int maxmem)
BLI_mutex_init(&GLOBAL_CACHE.mutex);
}
-/***************************** Global Cache **********************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Global Cache
+ * \{ */
static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf,
int tx,
@@ -353,7 +373,11 @@ static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf,
return gtile;
}
-/***************************** Per-Thread Cache ******************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Per-Thread Cache
+ * \{ */
static unsigned int *imb_thread_cache_get_tile(ImThreadTileCache *cache,
ImBuf *ibuf,
@@ -465,3 +489,5 @@ void IMB_tiles_to_rect(ImBuf *ibuf)
}
}
}
+
+/** \} */