Add vertex attribute validation to `Material` trait
Open
A-Rendering
C-Feature
C-Usability
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
Mesh attributes required by a material are not validated when using a material with a mesh.
## What solution would you like?
Extend the Material trait with something similar to `fn required_mesh_attributes() -> Option>`.
The default behaviour would return `None` and not validate anything. Otherwise, the validation would check that each attributes is present on the mesh and ignore other attributes since passing more attributes should be allowed.
## What alternative(s) have you considered?
N/A
## Additional context
Proposed in https://github.com/bevyengine/bevy/pull/6127 by @devil-ira
Contributor guide
Assessment
This issue has not been assessed yet.