Blender  V3.3
Classes
cache.c File Reference
#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 ImGlobalTileimb_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
 

Macro Definition Documentation

◆ IB_THREAD_CACHE_SIZE

#define IB_THREAD_CACHE_SIZE   100

Definition at line 34 of file cache.c.

Typedef Documentation

◆ ImGlobalTile

typedef struct ImGlobalTile ImGlobalTile

◆ ImGlobalTileCache

◆ ImThreadTile

typedef struct ImThreadTile ImThreadTile

◆ ImThreadTileCache

Function Documentation

◆ IMB_gettile()

unsigned int* IMB_gettile ( ImBuf ibuf,
int  tx,
int  ty,
int  thread 
)

◆ imb_global_cache_get_tile()

static ImGlobalTile* imb_global_cache_get_tile ( ImBuf ibuf,
int  tx,
int  ty,
ImGlobalTile replacetile 
)
static

◆ imb_global_cache_tile_load()

static void imb_global_cache_tile_load ( ImGlobalTile gtile)
static

◆ imb_global_cache_tile_unload()

static void imb_global_cache_tile_unload ( ImGlobalTile gtile)
static

◆ imb_global_tile_cmp()

static bool imb_global_tile_cmp ( const void a_p,
const void b_p 
)
static

Definition at line 91 of file cache.c.

References Freestyle::a, and usdtokens::b().

Referenced by IMB_tile_cache_params().

◆ imb_global_tile_hash()

static unsigned int imb_global_tile_hash ( const void gtile_p)
static

Definition at line 84 of file cache.c.

References ImGlobalTile::ibuf, ImGlobalTile::tx, and ImGlobalTile::ty.

Referenced by IMB_tile_cache_params().

◆ imb_thread_cache_exit()

static void imb_thread_cache_exit ( ImThreadTileCache cache)
static

Definition at line 190 of file cache.c.

References BLI_ghash_free(), NULL, and ImThreadTileCache::tilehash.

Referenced by imb_tile_cache_exit().

◆ imb_thread_cache_get_tile()

static unsigned int* imb_thread_cache_get_tile ( ImThreadTileCache cache,
ImBuf ibuf,
int  tx,
int  ty 
)
static

◆ imb_thread_cache_init()

static void imb_thread_cache_init ( ImThreadTileCache cache)
static

◆ imb_thread_tile_cmp()

static bool imb_thread_tile_cmp ( const void a_p,
const void b_p 
)
static

Definition at line 106 of file cache.c.

References Freestyle::a, and usdtokens::b().

Referenced by imb_thread_cache_init().

◆ imb_thread_tile_hash()

static unsigned int imb_thread_tile_hash ( const void ttile_p)
static

Definition at line 99 of file cache.c.

References ImThreadTile::ibuf, ImThreadTile::tx, and ImThreadTile::ty.

Referenced by imb_thread_cache_init().

◆ imb_tile_cache_exit()

void imb_tile_cache_exit ( void  )

◆ imb_tile_cache_init()

void imb_tile_cache_init ( void  )

◆ IMB_tile_cache_params()

void IMB_tile_cache_params ( int  totthread,
int  maxmem 
)

◆ imb_tile_cache_tile_free()

void imb_tile_cache_tile_free ( struct ImBuf ibuf,
int  tx,
int  ty 
)

◆ IMB_tiles_to_rect()

void IMB_tiles_to_rect ( ImBuf ibuf)

Variable Documentation

◆ GLOBAL_CACHE

ImGlobalTileCache GLOBAL_CACHE
static