|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "BLI_ghash.h"#include "BLI_listbase.h"#include "BLI_memarena.h"#include "BLI_threads.h"#include "BLI_utildefines.h"#include "IMB_filetype.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "imbuf.h"Go to the source code of this file.
Classes | |
| struct | ImGlobalTile |
| struct | ImThreadTile |
| struct | ImThreadTileCache |
| struct | ImGlobalTileCache |
Functions | |
Hash Functions | |
| static unsigned int | imb_global_tile_hash (const void *gtile_p) |
| static bool | imb_global_tile_cmp (const void *a_p, const void *b_p) |
| static unsigned int | imb_thread_tile_hash (const void *ttile_p) |
| static bool | imb_thread_tile_cmp (const void *a_p, const void *b_p) |
Load/Unload | |
| static void | imb_global_cache_tile_load (ImGlobalTile *gtile) |
| static void | imb_global_cache_tile_unload (ImGlobalTile *gtile) |
| void | imb_tile_cache_tile_free (ImBuf *ibuf, int tx, int ty) |
Init/Exit | |
| static void | imb_thread_cache_init (ImThreadTileCache *cache) |
| static void | imb_thread_cache_exit (ImThreadTileCache *cache) |
| void | imb_tile_cache_init (void) |
| void | imb_tile_cache_exit (void) |
| void | IMB_tile_cache_params (int totthread, int maxmem) |
Global Cache | |
| static ImGlobalTile * | imb_global_cache_get_tile (ImBuf *ibuf, int tx, int ty, ImGlobalTile *replacetile) |
Per-Thread Cache | |
| static unsigned int * | imb_thread_cache_get_tile (ImThreadTileCache *cache, ImBuf *ibuf, int tx, int ty) |
| unsigned int * | IMB_gettile (ImBuf *ibuf, int tx, int ty, int thread) |
| void | IMB_tiles_to_rect (ImBuf *ibuf) |
Local Structs | |
| #define | IB_THREAD_CACHE_SIZE 100 |
| typedef struct ImGlobalTile | ImGlobalTile |
| typedef struct ImThreadTile | ImThreadTile |
| typedef struct ImThreadTileCache | ImThreadTileCache |
| typedef struct ImGlobalTileCache | ImGlobalTileCache |
| static ImGlobalTileCache | GLOBAL_CACHE |
| typedef struct ImGlobalTile ImGlobalTile |
| typedef struct ImGlobalTileCache ImGlobalTileCache |
| typedef struct ImThreadTile ImThreadTile |
| typedef struct ImThreadTileCache ImThreadTileCache |
| unsigned int* IMB_gettile | ( | ImBuf * | ibuf, |
| int | tx, | ||
| int | ty, | ||
| int | thread | ||
| ) |
Definition at line 437 of file cache.c.
References GLOBAL_CACHE, imb_thread_cache_get_tile(), and ImGlobalTileCache::thread_cache.
|
static |
Definition at line 290 of file cache.c.
References BLI_addhead(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_remove(), BLI_memarena_alloc(), BLI_mutex_lock(), BLI_mutex_unlock(), BLI_remlink(), ListBase::first, GLOBAL_CACHE, ImGlobalTile::ibuf, imb_global_cache_tile_load(), imb_global_cache_tile_unload(), ListBase::last, ImGlobalTile::loading, ImGlobalTileCache::maxmem, ImGlobalTileCache::memarena, ImGlobalTileCache::mutex, NULL, ImGlobalTile::prev, ImGlobalTile::refcount, ImGlobalTileCache::tilehash, ImGlobalTileCache::tiles, ImBuf::tilex, ImBuf::tiley, ImGlobalTileCache::totmem, ImGlobalTile::tx, ImGlobalTile::ty, and ImGlobalTileCache::unused.
Referenced by imb_thread_cache_get_tile(), and IMB_tiles_to_rect().
|
static |
Definition at line 134 of file cache.c.
References ImGlobalTile::ibuf, imb_loadtile(), MEM_callocN, ImBuf::tiles, ImBuf::tilex, ImBuf::tiley, ImGlobalTile::tx, ImGlobalTile::ty, and ImBuf::xtiles.
Referenced by imb_global_cache_get_tile().
|
static |
Definition at line 145 of file cache.c.
References GLOBAL_CACHE, ImGlobalTile::ibuf, MEM_freeN, NULL, ImBuf::tiles, ImBuf::tilex, ImBuf::tiley, ImGlobalTileCache::totmem, ImGlobalTile::tx, ImGlobalTile::ty, and ImBuf::xtiles.
Referenced by imb_global_cache_get_tile(), and imb_tile_cache_exit().
|
static |
Definition at line 105 of file cache.c.
References Freestyle::a, ImGlobalTile::ibuf, ImGlobalTile::tx, and ImGlobalTile::ty.
Referenced by IMB_tile_cache_params().
|
static |
Definition at line 98 of file cache.c.
References ImGlobalTile::ibuf, ImGlobalTile::tx, and ImGlobalTile::ty.
Referenced by IMB_tile_cache_params().
|
static |
Definition at line 205 of file cache.c.
References BLI_ghash_free(), NULL, and ImThreadTileCache::tilehash.
Referenced by imb_tile_cache_exit().
|
static |
Definition at line 382 of file cache.c.
References BLI_addhead(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_remove(), BLI_listbase_is_empty(), BLI_remlink(), ListBase::first, ImThreadTile::global, ImGlobalTile::ibuf, ImThreadTile::ibuf, imb_global_cache_get_tile(), ListBase::last, NULL, ImThreadTileCache::tilehash, ImBuf::tiles, ImThreadTileCache::tiles, ImGlobalTile::tx, ImThreadTile::tx, ImGlobalTile::ty, ImThreadTile::ty, ImThreadTileCache::unused, and ImBuf::xtiles.
Referenced by IMB_gettile().
|
static |
Definition at line 188 of file cache.c.
References Freestyle::a, BLI_addtail(), BLI_ghash_new(), BLI_memarena_alloc(), GLOBAL_CACHE, IB_THREAD_CACHE_SIZE, imb_thread_tile_cmp(), imb_thread_tile_hash(), ImGlobalTileCache::memarena, ImThreadTileCache::tilehash, and ImThreadTileCache::unused.
Referenced by IMB_tile_cache_params().
|
static |
Definition at line 120 of file cache.c.
References Freestyle::a, ImThreadTile::ibuf, ImThreadTile::tx, and ImThreadTile::ty.
Referenced by imb_thread_cache_init().
|
static |
Definition at line 113 of file cache.c.
References ImThreadTile::ibuf, ImThreadTile::tx, and ImThreadTile::ty.
Referenced by imb_thread_cache_init().
| void imb_tile_cache_exit | ( | void | ) |
Definition at line 223 of file cache.c.
References Freestyle::a, BLI_ghash_free(), BLI_memarena_free(), BLI_mutex_end(), ListBase::first, GLOBAL_CACHE, imb_global_cache_tile_unload(), imb_thread_cache_exit(), ImGlobalTileCache::initialized, ImGlobalTileCache::memarena, ImGlobalTileCache::mutex, ImGlobalTile::next, NULL, ImGlobalTileCache::thread_cache, ImGlobalTileCache::tilehash, ImGlobalTileCache::tiles, and ImGlobalTileCache::totthread.
Referenced by IMB_exit(), and IMB_tile_cache_params().
| void imb_tile_cache_init | ( | void | ) |
Definition at line 210 of file cache.c.
References BLI_mutex_init(), GLOBAL_CACHE, IMB_tile_cache_params(), ImGlobalTileCache::initialized, and ImGlobalTileCache::mutex.
Referenced by IMB_init().
| void IMB_tile_cache_params | ( | int | totthread, |
| int | maxmem | ||
| ) |
Definition at line 252 of file cache.c.
References Freestyle::a, BLI_ghash_new(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_memarena_use_calloc(), BLI_mutex_init(), GLOBAL_CACHE, imb_global_tile_cmp(), imb_global_tile_hash(), imb_thread_cache_init(), imb_tile_cache_exit(), ImGlobalTileCache::maxmem, ImGlobalTileCache::memarena, ImGlobalTileCache::mutex, ImGlobalTileCache::thread_cache, ImGlobalTileCache::tilehash, and ImGlobalTileCache::totthread.
Referenced by imb_tile_cache_init().
| void imb_tile_cache_tile_free | ( | ImBuf * | ibuf, |
| int | tx, | ||
| int | ty | ||
| ) |
Definition at line 157 of file cache.c.
References BLI_addtail(), BLI_ghash_lookup(), BLI_ghash_remove(), BLI_mutex_lock(), BLI_mutex_unlock(), BLI_remlink(), GLOBAL_CACHE, ImGlobalTile::ibuf, ImGlobalTile::loading, ImGlobalTileCache::mutex, NULL, ImGlobalTileCache::tilehash, ImGlobalTileCache::tiles, ImGlobalTile::tx, ImGlobalTile::ty, and ImGlobalTileCache::unused.
Referenced by imb_freetilesImBuf().
| void IMB_tiles_to_rect | ( | ImBuf * | ibuf | ) |
Definition at line 442 of file cache.c.
References Freestyle::a, BLI_mutex_lock(), BLI_mutex_unlock(), ImBuf::flags, from, GLOBAL_CACHE, IB_rect, IMB_getmipmap(), imb_global_cache_get_tile(), ImBuf::mall, MEM_callocN, ImBuf::miptot, ImGlobalTileCache::mutex, NULL, ImBuf::rect, ImGlobalTile::refcount, ImBuf::tiles, ImBuf::tilex, ImBuf::tiley, w(), ImBuf::x, ImBuf::xtiles, y, ImBuf::y, and ImBuf::ytiles.
|
static |
Definition at line 90 of file cache.c.
Referenced by IMB_gettile(), imb_global_cache_get_tile(), imb_global_cache_tile_unload(), imb_thread_cache_init(), imb_tile_cache_exit(), imb_tile_cache_init(), IMB_tile_cache_params(), imb_tile_cache_tile_free(), and IMB_tiles_to_rect().