-
-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: a new package for memory-efficient asset management #3100
Comments
Q. What if we want to use CDN as a backend? |
The backend doesn't have to be a type Backend interface {
Open(path string) (io.ReadSeekCloser, error)
}
func NewBackendFromFS(fs fs.FS) Backend
func New(backend Backend) *AssetManager |
I realized there are two memory regions: CPU and GPU. The aim is to minimize GPU memory usages compared to CPU memory usages. For Audio, only CPU memory matters. Thus, the APIs to set lifetime should be like this:
|
To note, merged filesystems can be good/important for modding. e.g., you load your base assets, then load other implementations on top of the base to override. See https://github.com/kettek/go-multipath -- it's basically just a virtualized FS that aggregates multiple FS sources based upon a hierarchy. |
I think having |
Yes, that should actually be sufficient. |
Operating System
What feature would you like to be added?
Overview
From our experiment in our games (Odencat Inc.) and other games, we found we often had to implement an asset manager for memory efficiency. Memory efficiency is important for some low-end platforms like mobiles, browsers, and consoles. However, it is annoying to implement such a manager for each game.
I propose to have an official asset manager for such use cases.
API
Rationale
Why not an independent module?
AssetManager has to know the last usage of an image, thus AssetManager has to access the internal of Ebitengine.
The text was updated successfully, but these errors were encountered: