18#ifndef vtkOpenGLArrayTextureBufferCache_h
19#define vtkOpenGLArrayTextureBufferCache_h
23#include "vtkRenderingOpenGL2Module.h"
33VTK_ABI_NAMESPACE_BEGIN
71 vtkDataArray* array,
bool scalarComponents,
bool integerTexture);
150 using Key = std::tuple<vtkDataArray*, bool, bool>;
151 std::map<Key, std::shared_ptr<Entry>>
Cache;
a simple class to control print indentation
~vtkOpenGLArrayTextureBufferCache() override
std::size_t GetCurrentCacheSize() const
Sum of GPU bytes held by all cached entries, computed on demand (the owning adapters may reallocate a...
std::tuple< vtkDataArray *, bool, bool > Key
std::uint64_t AccessCounter
Monotonic clock for Entry::LastAccess stamps.
static bool EntryIsPinned(const Entry &entry)
True when the entry's Texture or Buffer is referenced outside the entry itself (the entry accounts fo...
std::size_t GetNumberOfCachedTextureBuffers() const
Return the number of distinct (array, role) texture buffers currently cached.
std::size_t RemoveTextureBuffer(vtkDataArray *array, vtkWindow *window)
Erase every unpinned entry keyed on the given array (all layout variants).
vtkOpenGLArrayTextureBufferCache()
static std::size_t GetEntrySize(const Entry &entry)
GPU bytes held by one entry: exact buffer size on desktop, computed from the emulation texture's dime...
static vtkOpenGLArrayTextureBufferCache * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::size_t MaximumCacheSize
void ReleaseGraphicsResources(vtkWindow *window)
Release the GL resources held by every cached entry and forget them.
unsigned long GetCPUMemorySize() const
Return the host-side memory, in KiB, consumed by the source arrays the cached entries keep alive.
std::shared_ptr< Entry > GetTextureBuffer(vtkDataArray *array, bool scalarComponents, bool integerTexture)
Return the shared entry for the given (array, scalarComponents, integerTexture), creating an empty en...
static void ReleaseEntry(Entry &entry, vtkWindow *window)
Release the entry's GL objects and reset it to the never-uploaded state.
void RemoveUnusedTextureBuffers(vtkWindow *window)
Eviction ladder is:
std::map< Key, std::shared_ptr< Entry > > Cache
Hold a reference to a vtkObjectBase instance.
window superclass for vtkRenderWindow
A cached texture buffer for one (array, role).
vtkSmartPointer< vtkOpenGLBufferObject > Buffer
vtkSmartPointer< vtkDataArray > Array
vtkSmartPointer< vtkTextureObject > Texture
std::uint64_t LastAccess
Monotonic stamp of the last GetTextureBuffer() that returned this entry; orders entries least-recentl...
vtkTypeUInt32 vtkMTimeType