11 #ifndef RE_BufferCache_h
12 #define RE_BufferCache_h
40 void setMaxSizeB(
int64 maxsize);
66 myCurSizeB =
SYSmax(0, myCurSizeB+delta_size);
75 void pruneUnusedBuffers();
85 {
return "OpenGL Vertex Cache"; }
95 {
return myCurSizeB - myUnusedSizeB; }
101 void removeFromUnusedBufferList(
const UT_StringRef &key,
104 BufferPool myUsedBuffers;
105 UnusedBufferPool myUnusedBuffers;
106 UnusedBuffer *myLRUBufferList;
107 UnusedBuffer *myLRUBufferTail;
112 bool myCacheEnabled =
true;
GLenum GLuint GLenum GLsizei const GLchar * buf
int64 utGetMinSize() const override
int64 utGetMaxSize() const override
bool utHasMaxSize() const override
optional - override if the cache has a well defined maximum size
GLenum GLenum GLsizei const GLuint GLboolean enabled
virtual int64 utReduceCacheSizeBy(int64 amount)=0
int64 getCurSizeB() const
Current cache size, in bytes.
Wrapper around hboost::intrusive_ptr.
GLuint const GLchar * name
Common base class for various caches.
bool utIsEnabled() const override
optional - is this cache currently operational.
void updateBufferSize(int64 delta_size)
call if a cached buffer changes size, with the change in size.
void setEnabled(bool enabled)
int64 getMaxSizeB() const
Maximum cache size, in bytes.
void utSetMaxSize(int64 size) override
const char * utGetCacheName() const override
required - return the english name for this cache.
int64 utGetCurrentSize() const override
required - return the current cache size, in bytes