-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
At the moment the bind groups are generated for every shader with the index as name (BindGroup0, BindGroup1, ...)
I would like the reuse bind groups if possible
- Every type must be shared (demangle with module)
- A bind group can be reused if the binding indices and corresponding types match
Idea
- Add setting
share_bind_groups: boolor similar- Only possible with demangle
- Place the wrapper in the deepest common module
- For the shader add method
fn bind_bind_group_0(bind_group: &BindGroupShared)- The shared bind group has no fixed bind group index
- Add setting
bind_group_type_with_namesor similar- Instead of the index use the binding names for the type name
- See example below
- No clue if the member names or types are better suited for the name
- Always used for shared bind groups, because they have no index
Example for bind_group_type_with_names
@group(0) @binding(0) camera: Camera,
@group(1) @binding(0) settings: Settings,
@group(1) @binding(1) world: World, pub struct BindGroupCamera(...);
pub struct BindGroupSettingsWorld(...);Metadata
Metadata
Assignees
Labels
No labels