-
Notifications
You must be signed in to change notification settings - Fork 140
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
Allow initialising shaders in parallel #455
Conversation
Is there any reason somebody would want not to initialize in parallel if it is supported on the platform? Memory? (talking about aside from cases where people have their own thread pooling) |
I'll give it a go and let you know. |
There is also a possibility of starving other threads of the resources they need. And yeah, there is some additional (temporary) memory usage required, although I think (but haven't checked exact numbers) that the amount should be minimal |
I think you left off something... |
Thanks, resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the bits I was worried about commitment to semver for it turns out are not actually pub
at the package level, this seems fine to me.
Headline stats: Reduces shader initialisation time from ~5seconds on Pixel 6 to ~2 seconds (with no compromises on runtime performance)
This is disabled on wasm because there are no threads.
This is disabled on macOS, following the prior art in Bevy (bevyengine/bevy#10812 (comment))
This work queuing system is not intended to be the final form of this, which is why I have made this optional.
This would not be suitable for many consumers, who will likely already have their own thread pool.
We currently just create short lived threads using
std::thread::scope
.I still think this is useful to have for experimental purposes, and I think it should also be useful in Xilem in its current form. @xorgy might need you to confirm that
This is not async shader initialisation, which I do also plan to add. This is a useful first step towards that, however