11 #ifndef TIL_TILE_CACHE_H
12 #define TIL_TILE_CACHE_H
28 class til_ResourceSlush;
32 class TIL_NodePlaneId;
36 const char *plane_name,
47 void setCacheSize(
int size_in_kb,
bool force_redo =
false);
48 void setInactiveCacheReduce(
bool enable,
int size_in_kb);
52 { myExternalResourceUsage = bytes_used; }
58 void setCookMode(
bool cook);
116 {
return privLockTile(tile, access, block,
false); }
119 { privUnlockTile(tile,access,
false); }
122 { privLockTileWriteToRead(tile,score,
false); }
125 {
return t->myReadLocks; }
127 {
return t->myWriteLock; }
138 void moveTileFromCacheToCheckpointList(
153 void possiblyResumeTrimming();
156 void removeAllWithParent(
void *node);
159 {
return myCheckpointTiles.entries(); }
162 {
return myLockedTiles.entries(); }
165 void uncheckpointAllTiles();
166 void unlockAllTiles();
180 static void cacheReducePing(UI_Timer *
t,
void *
data);
185 void dumpContents(std::ostream &os);
205 void deallocateTile(
TIL_Tile *tile);
207 bool returnTileFromLocked(
TIL_Tile *tile);
208 void makeRoomFor(
int64 newmemsize);
214 bool already_locked);
216 bool already_locked);
217 void privLockTileWriteToRead(
TIL_Tile *tile,
int score,
218 bool already_locked);
221 void reduceCacheSize();
239 {
return key.hash(); }
257 int64 myMaxCacheSize;
258 int64 myMaxInactiveSize;
259 int64 myExternalResourceUsage;
266 til_ResourceSlush *my8BitSlush;
267 til_ResourceSlush *my16BitSlush;
268 til_ResourceSlush *my32BitSlush;
272 bool myInactiveReduce;
273 int mySuspendCacheTrimCount;
void unlockTile(TIL_Tile *tile, int access)
bool getInactiveReduce() const
getFileOption("OpenEXR:storage") storage
std::size_t SYS_HashType
Define the type for hash values.
const char * utGetCacheName() const override
required - return the english name for this cache.
int64 getCacheSize() const
int64 utGetMaxSize() const override
unsigned getNumCheckpointedTiles() const
bool utHasMaxSize() const override
optional - override if the cache has a well defined maximum size
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
virtual int64 utReduceCacheSizeBy(int64 amount)=0
SYS_HashType operator()(const TileKey &key) const
GLuint GLint GLboolean GLint GLenum access
int64 getInactiveCacheSize() const
unsigned int getNumLockedTiles() const
Common base class for various caches.
int64 utGetCurrentSize() const override
required - return the current cache size, in bytes
void lockTileWriteToRead(TIL_Tile *tile, int score)
virtual void utSetMaxSize(int64)
bool(* TIL_IsPlaneCheckpointedCallbackType)(void *opaque_cop_node, const char *plane_name, float cook_time)
int isReadLocked(const TIL_Tile *t) const
void setExternalResourceUsage(int64 bytes_used)
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
GLdouble GLdouble GLdouble y2
int64 getMaxCacheSize() const
int isWriteLocked(const TIL_Tile *t) const
int lockTile(TIL_Tile *tile, int access, int block=1)