Commit 5d7a605
authored
Add a new
Currently, the structure-level `#[uniform]` attribute of `AsBindGroup`
creates a binding array of individual buffers, each of which contains
data for a single material. A more efficient approach would be to
provide a single buffer with an array containing all of the data for all
materials in the bind group. Because `StandardMaterial` uses
`#[uniform]`, this can be notably inefficient with large numbers of
materials.
This patch introduces a new attribute on `AsBindGroup`, `#[data]`, which
works identically to `#[uniform]` except that it concatenates all the
data into a single buffer that the material bind group allocator itself
manages. It also converts `StandardMaterial` to use this new
functionality. This effectively provides the "material data in arrays"
feature.#[data] attribute to AsBindGroup that allows packing data for multiple materials into a single array. (#17965)1 parent a171733 commit 5d7a605
File tree
7 files changed
+479
-132
lines changed- crates
- bevy_pbr/src
- render
- bevy_render
- macros/src
- src/render_resource
7 files changed
+479
-132
lines changed
0 commit comments