34 #define IB_THREAD_CACHE_SIZE 100
88 return ((
unsigned int)(
intptr_t)gtile->
ibuf) * 769 + gtile->
tx * 53 + gtile->
ty * 97;
96 return ((
a->ibuf !=
b->ibuf) || (
a->tx !=
b->tx) || (
a->ty !=
b->ty));
103 return ((
unsigned int)(
intptr_t)ttile->
ibuf) * 769 + ttile->
tx * 53 + ttile->
ty * 97;
111 return ((
a->ibuf !=
b->ibuf) || (
a->tx !=
b->tx) || (
a->ty !=
b->ty));
123 int toffs = ibuf->
xtiles * gtile->
ty + gtile->
tx;
128 ibuf->
tiles[toffs] = rect;
134 int toffs = ibuf->
xtiles * gtile->
ty + gtile->
tx;
148 lookuptile.
ibuf = ibuf;
261 for (
a = 0;
a < totthread;
a++) {
288 lookuptile.
ibuf = ibuf;
373 int toffs = ibuf->
xtiles * ty + tx;
378 if (ttile->
ibuf == ibuf && ttile->
tx == tx && ttile->
ty == ty) {
379 return ibuf->
tiles[toffs];
383 lookuptile.
ibuf = ibuf;
391 return ibuf->
tiles[toffs];
398 replacetile = ttile->
global;
414 ttile->
tx = gtile->
tx;
415 ttile->
ty = gtile->
ty;
418 return ibuf->
tiles[toffs];
430 unsigned int *to, *
from;
431 int a, tx, ty,
y,
w, h;
439 "imb_addrectImBuf"))) {
448 for (ty = 0; ty < mipbuf->
ytiles; ty++) {
449 for (tx = 0; tx < mipbuf->
xtiles; tx++) {
456 to = mipbuf->
rect + mipbuf->
x * ty * mipbuf->
tiley + tx * mipbuf->
tilex;
462 for (
y = 0;
y < h;
y++) {
463 memcpy(to,
from,
sizeof(
unsigned int) *
w);
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) 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)
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)
struct MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
#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)
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)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
_W64 unsigned int uintptr_t
ImThreadTileCache thread_cache[BLENDER_MAX_THREADS+1]
struct ImGlobalTile * prev
struct ImGlobalTile * next
struct ImThreadTile * prev
struct ImThreadTile * next