You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of #187, multiple images in multiple atlases are supported and paths are deduplicated. Images are loaded immediately (even if never used), and are only freed if manually cleared (which might not happen; drop handlers can't do so automatically).
On-demand loading
Potentially we can improve this with on-demand loading as follows:
load_path creates an ID, reads the path only to find the image size, and creates a mapping from the ID to the path and size
when creating a render queue using a not-loaded image ID, use the cached size to allocate to an atlas, and queue loading the image in a background thread
in images::Pipeline::prepare block until the image is loaded
Caveat: we end up reading from all used images twice. This may be worse than simply loading them?
Variant: add a hint in load_path controlling whether immediate loading happens.
GC / auto freeing
Given the above, we could implement some garbage collector, e.g. by adding frame-number-of-last-use to each image, to automatically free unused images.
The text was updated successfully, but these errors were encountered:
As of #187, multiple images in multiple atlases are supported and paths are deduplicated. Images are loaded immediately (even if never used), and are only freed if manually cleared (which might not happen; drop handlers can't do so automatically).
On-demand loading
Potentially we can improve this with on-demand loading as follows:
load_path
creates an ID, reads the path only to find the image size, and creates a mapping from the ID to the path and sizeimages::Pipeline::prepare
block until the image is loadedCaveat: we end up reading from all used images twice. This may be worse than simply loading them?
Variant: add a hint in
load_path
controlling whether immediate loading happens.GC / auto freeing
Given the above, we could implement some garbage collector, e.g. by adding frame-number-of-last-use to each image, to automatically free unused images.
The text was updated successfully, but these errors were encountered: