10 #ifndef RV_TextureCache_h
11 #define RV_TextureCache_h
31 #define RV_INVALID_OP_ID -1
39 class RV_TextureResolver;
57 static void updateTextures();
60 static exint cacheVersion();
63 static exint cacheRefresh();
65 static exint currentSizeBytes();
67 static exint totalTextureCount();
107 bool &deferred_loaded,
109 TexturePriority priority = PRIORITY_NORMAL,
110 PlaceholderType missing=MISSING_WHITE_SOLID,
127 PlaceholderType placeholder_type,
140 bool allow_deferred_load,
141 bool &defer_load_finished,
143 TexturePriority priority = PRIORITY_NORMAL,
172 static void checkTextureDirty(
RV_TextureRef &map,
bool &dirty);
175 static void checkTextureHasAlpha(
const RV_TextureRef &
ref,
bool &has_alpha);
181 static void setSingleTexMemLimitMB(
exint mem_in_mb);
182 static exint singleTexMemLimitMB();
184 static void setCacheSize(
exint mem_in_bytes);
213 bool check_alpha =
false;
220 bool loading =
false;
247 bool &missing_texture,
264 const
char *utGetCacheName()
const override
265 {
return "Vulkan Texture Cache"; }
267 {
return myCurrentSize; }
269 {
return freeTextures(amount,
true,
false); }
271 int64 utGetMaxSize()
const override;
277 exint freeTextures(
exint needed_to_free,
bool free_used,
bool must_free);
278 exint cachedSizeBytes()
const;
285 const char *
name()
const override
286 {
return "Vulkan Texture Cache";}
292 exint &freed_amount_in_bytes)
override;
295 exint &cached_bytes)
override;
297 ~GraphicsMemoryClient()
override {}
304 GraphicsMemoryClient myResource;
323 exint myCurrentSize = 0;
324 fpreal myReductionFactor = 1.0;
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
int64 utGetCurrentSize() const override
required - return the current cache size, in bytes
UT_StringHolder op_relative
Opaque reference to a texture stored in the RV_TextureCache.
GLenum GLenum GLsizei void * image
UT_SharedPtr< RV_TextureRef::CacheData > refs
bool utHasMaxSize() const override
optional - override if the cache has a well defined maximum size
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
GLint GLsizei GLsizei height
GLint GLint GLsizei GLint GLenum GLenum type
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr auto set(type rhs) -> int
T reduce(RangeT range, const T &identity, const FuncT &func, const JoinT &join)
UT_Array< UT_UniquePtr< PXL_Raster > > rasters
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLfloat GLfloat GLfloat alpha
void utSetMaxSize(int64) override
UT_UniquePtr< IMG_Stat > stat
HUSD_API const char * resolution()
GLuint const GLchar * name
UT_StringHolder cache_name
PlaceholderType
If the texture is missing, one of these generic placeholders is used.
Handle to the main interface of Vulkan.
Common base class for various caches.
static const char * getFileSeparator()
FS_API bool cleanup(UT_StringArray &removed, UT_StringArray &error_files, exint &memory_freed, bool dry_run, const char *override_path=nullptr)
GLint GLint GLsizei GLsizei GLsizei depth
GT_API const UT_StringHolder version
Global cache of vulkan textures sourced from files.
Contains the details of a specific image file, used by IMG_File. This class contains all the high-lev...
Wrapper for a client of a limit memory resource.
void(* RV_TextureHDAResolverCB)(const char *optable_optype, const char *pattern, UT_StringArray &files)
int64 utReduceCacheSizeBy(int64 amount) override
UT_UniquePtr< RV_VKImage > image