21 #include "scm-queue.hpp"
22 #include "scm-fifo.hpp"
24 #include "scm-set.hpp"
50 int get_grid_size()
const {
return s; }
51 int get_page_size()
const {
return n; }
54 int get_page(
int,
long long,
int,
int&);
75 int get_slot(
int,
long long);
78 typedef std::vector<scm_cache *> scm_cache_v;
79 typedef std::vector<scm_cache *>::iterator scm_cache_i;
static int need_queue_size
The maximum number of page load requests allowed at any moment. (Requests from the render thread to t...
Definition: scm-cache.hpp:41
static int load_queue_size
The maximum number of page load results allowed at any moment. (Results from the loader threads to th...
Definition: scm-cache.hpp:42
int get_page(int, long long, int, int &)
Return the cache line of a loaded page.
Definition: scm-cache.cpp:166
An scm_task represents a page load task, as executed by a loader thread.
Definition: scm-task.hpp:34
void add_load(scm_task &)
Add a page request to the load queue.
Definition: scm-cache.cpp:141
void update(int, bool)
Handle incoming textures on the loads queue, copying them to the atlas.
Definition: scm-cache.cpp:254
static int loads_per_cycle
The maximum number of page load results that may be uploaded to the atlas by the render thread each f...
Definition: scm-cache.hpp:43
GLuint get_texture() const
Return the OpenGL texture object representing the cache.
Definition: scm-cache.cpp:150
void flush()
Eject all pages.
Definition: scm-cache.cpp:346
~scm_cache()
Destroy a page cache and finalize all OpenGL state.
Definition: scm-cache.cpp:118
scm_cache(scm_system *, int, int, int)
Create a new page cache with a queue for making page requests.
Definition: scm-cache.cpp:67
void render(int, int)
Render a 2D overlay of the contents of all caches.
Definition: scm-cache.cpp:293
static int cache_threads
The number of loader threads servicing page load requests for each cache.
Definition: scm-cache.hpp:40
static int cache_size
The cache grid size. The texture atlas will have size N x N where N = grid_size * page_size...
Definition: scm-cache.hpp:39
An scm_set represents an a set of active pages, either currently in a cache or awaiting loading...
Definition: scm-set.hpp:41
An scm_system encapsulates all of the state of an SCM renderer. Its interface is the primary API of t...
Definition: scm-system.hpp:175
An scm_cache is a virtual texture, demand-paged with threaded data access, represented as a single la...
Definition: scm-cache.hpp:35