-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Use RenderStartup for meshlets.
#20210
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
| ( | ||
| check_meshlet_features, | ||
| ( | ||
| ( | ||
| // This captures cluster_buffer_slots to create the resource manager. | ||
| move |mut commands: Commands, render_device: Res<RenderDevice>| { | ||
| commands.insert_resource(ResourceManager::new( | ||
| cluster_buffer_slots, | ||
| &render_device, | ||
| )); | ||
| }, | ||
| init_meshlet_pipelines, | ||
| ) | ||
| .chain(), | ||
| init_meshlet_mesh_manager, | ||
| ), | ||
| ) | ||
| .chain(), |
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.
this is a pretty dreadful amount of nesting, can any of it be split into a let binding or something?
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 realized I could split off the closure into a variable and I think this makes it much more tolerable. There's still the same amount of nesting, but I think it's easier to see what's happening.
ec77a33 to
01cf3f5
Compare
| .add_systems( | ||
| RenderStartup, | ||
| ( | ||
| check_meshlet_features, | ||
| ( | ||
| (init_resource_manager_system, init_meshlet_pipelines).chain(), | ||
| init_meshlet_mesh_manager, | ||
| ), | ||
| ) | ||
| .chain(), | ||
| ) |
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.
take this with an extremely large grain of salt, just wondering if something like this can help maybe? deliberately not a "suggestion"
.add_systems(
RenderStartup,
(
(check_meshlet_features, init_meshlet_mesh_manager).chain(),
(init_resource_manager_system, init_meshlet_pipelines).chain()
.after(check_meshlet_features),
)
)
Objective
Solution
RenderStartup.ResourceManagerto capture thecluster_buffer_slots.Testing
meshletexample and it behaves the same as main.