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
I have a scene definition language (cuicui_chirp) that may depend on the content of other files.
I call "dependent" the file that depends on another one, while "dependency" is the file a dependent file depends on.
I need the actual content of the dependency file in order to interpret dependent files.
The current LoadContext interface let me access the content of a different asset through the LoadContext::load_direct API. However, in my situation, I will have many dependent that depend on a single dependency. load_direct does not cache/re-use loaded assets. Which is problematic, I want to load and parse each file once, then re-use the AST.
Shaders has a similar issue. The implementation of loading and re-using shader dependency in bevy is very complex, and could benefit from re-using a holistic bevy_asset solution.
Potential solutions
In my case, I could implement a complex solution similar to bevy's shader system. But that's (1) reinventing the wheel (2) a large burden (3) doesn't solve the problem for other users and use cases.
What I would like to see:
An alternative to load_direct that returns a Cow<A> (or a clone of A), providing a reference to the asset from the Assets store if it is already loaded.
The text was updated successfully, but these errors were encountered:
nicopap
added
C-Feature
A new feature, making something new possible
A-Assets
Load files from disk to use for things like images, models, and sounds
labels
Nov 16, 2023
Problem
I have a scene definition language (
cuicui_chirp
) that may depend on the content of other files.I call "dependent" the file that depends on another one, while "dependency" is the file a dependent file depends on.
I need the actual content of the dependency file in order to interpret dependent files.
The current
LoadContext
interface let me access the content of a different asset through theLoadContext::load_direct
API. However, in my situation, I will have many dependent that depend on a single dependency.load_direct
does not cache/re-use loaded assets. Which is problematic, I want to load and parse each file once, then re-use the AST.Shaders has a similar issue. The implementation of loading and re-using shader dependency in bevy is very complex, and could benefit from re-using a holistic
bevy_asset
solution.Potential solutions
In my case, I could implement a complex solution similar to bevy's shader system. But that's (1) reinventing the wheel (2) a large burden (3) doesn't solve the problem for other users and use cases.
What I would like to see:
load_direct
that returns aCow<A>
(or a clone ofA
), providing a reference to the asset from theAssets
store if it is already loaded.The text was updated successfully, but these errors were encountered: