48 #define IB_THREAD_CACHE_SIZE 100
102 return ((
unsigned int)(
intptr_t)gtile->
ibuf) * 769 + gtile->
tx * 53 + gtile->
ty * 97;
110 return ((
a->ibuf != b->
ibuf) || (
a->tx != b->
tx) || (
a->ty != b->
ty));
117 return ((
unsigned int)(
intptr_t)ttile->
ibuf) * 769 + ttile->
tx * 53 + ttile->
ty * 97;
125 return ((
a->ibuf != b->
ibuf) || (
a->tx != b->
tx) || (
a->ty != b->
ty));
137 int toffs = ibuf->
xtiles * gtile->
ty + gtile->
tx;
142 ibuf->
tiles[toffs] = rect;
148 int toffs = ibuf->
xtiles * gtile->
ty + gtile->
tx;
163 lookuptile.
ibuf = ibuf;
277 for (
a = 0;
a < totthread;
a++) {
304 lookuptile.
ibuf = ibuf;
389 int toffs = ibuf->
xtiles * ty + tx;
394 if (ttile->
ibuf == ibuf && ttile->
tx == tx && ttile->
ty == ty) {
395 return ibuf->
tiles[toffs];
399 lookuptile.
ibuf = ibuf;
407 return ibuf->
tiles[toffs];
414 replacetile = ttile->
global;
430 ttile->
tx = gtile->
tx;
431 ttile->
ty = gtile->
ty;
434 return ibuf->
tiles[toffs];
446 unsigned int *to, *
from;
447 int a, tx, ty,
y,
w, h;
455 "imb_addrectImBuf"))) {
464 for (ty = 0; ty < mipbuf->
ytiles; ty++) {
465 for (tx = 0; tx < mipbuf->
xtiles; tx++) {
472 to = mipbuf->
rect + mipbuf->
x * ty * mipbuf->
tiley + tx * mipbuf->
tilex;
478 for (
y = 0;
y < h;
y++) {
479 memcpy(to,
from,
sizeof(
unsigned int) *
w);
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1)
#define BLI_MEMARENA_STD_BUFSIZE
void BLI_memarena_use_calloc(struct MemArena *ma) ATTR_NONNULL(1)
void * BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
struct MemArena * BLI_memarena_new(const size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) ATTR_MALLOC
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_mutex_init(ThreadMutex *mutex)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
#define BLENDER_MAX_THREADS
pthread_mutex_t ThreadMutex
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
void imb_loadtile(struct ImBuf *ibuf, int tx, int ty, unsigned int *rect)
struct ImBuf * IMB_getmipmap(struct ImBuf *ibuf, int level)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static unsigned int * imb_thread_cache_get_tile(ImThreadTileCache *cache, ImBuf *ibuf, int tx, int ty)
struct ImGlobalTile ImGlobalTile
static ImGlobalTile * imb_global_cache_get_tile(ImBuf *ibuf, int tx, int ty, ImGlobalTile *replacetile)
void imb_tile_cache_tile_free(ImBuf *ibuf, int tx, int ty)
static bool imb_thread_tile_cmp(const void *a_p, const void *b_p)
static unsigned int imb_thread_tile_hash(const void *ttile_p)
unsigned int * IMB_gettile(ImBuf *ibuf, int tx, int ty, int thread)
static unsigned int imb_global_tile_hash(const void *gtile_p)
struct ImGlobalTileCache ImGlobalTileCache
struct ImThreadTile ImThreadTile
void IMB_tiles_to_rect(ImBuf *ibuf)
void imb_tile_cache_exit(void)
#define IB_THREAD_CACHE_SIZE
struct ImThreadTileCache ImThreadTileCache
static void imb_thread_cache_init(ImThreadTileCache *cache)
static void imb_global_cache_tile_unload(ImGlobalTile *gtile)
void imb_tile_cache_init(void)
static void imb_thread_cache_exit(ImThreadTileCache *cache)
static ImGlobalTileCache GLOBAL_CACHE
static void imb_global_cache_tile_load(ImGlobalTile *gtile)
void IMB_tile_cache_params(int totthread, int maxmem)
static bool imb_global_tile_cmp(const void *a_p, const void *b_p)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
_W64 unsigned int uintptr_t
ImThreadTileCache thread_cache[BLENDER_MAX_THREADS+1]
struct ImGlobalTile * prev
struct ImGlobalTile * next
struct ImThreadTile * prev
struct ImThreadTile * next