-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Composable Pipeline Specialization #17373
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
Conversation
cc5d27d
to
3b79eb0
Compare
still dying because of HashMap. Why?
3b79eb0
to
7e084d4
Compare
620170e
to
5a33a21
Compare
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.
i agree with the overall direction of this
From the high level description, I’m on board with this. I feel like the naming is a bit off. SpecializeMeshPipeline for example does feel like it’s missing a d which would make it the same as the existing name. I’d say make the names feel right, break APIs, and document migrations. |
Head branch was pushed to by a user without write access
- renamed `spec_v2` related modules, that commit slipped through the other pr #17373 - revised struct and trait docs for clarity, and gave a short intro to specialization - turns out the derive macro was broken, fixed that too
Currently, our specialization API works through a series of wrapper structs and traits, which make things confusing to follow and difficult to generalize.
This pr takes a different approach, where "specializers" (types that implement
Specialize
) are composable, but "flat" rather than composed of a series of wrappers. The key is that specializers don't produce pipeline descriptors, but instead modify existing ones:This lets us use some derive magic to stick multiple specializers together:
This approach is much easier to understand, IMO, and also lets us separate concerns better. Specializers can be placed in fully separate crates/modules, and key computation can be shared as well.
The only real breaking change here is that since specializers only modify descriptors, we need a "base" descriptor to work off of. This can either be manually supplied when constructing a
Specializer
(the new collection replacingSpecialized[Render/Compute]Pipelines
), or supplied by implementingHasBaseDescriptor
on a specializer. Seeexamples/shader/custom_phase_item.rs
for an example implementation.Testing
Showcase