bevy/crates/bevy_pbr
Robert Swain b44b606d29 bevy_pbr: Avoid copying structs and using registers in shaders (#7069)
# Objective

- The #7064 PR had poor performance on an M1 Max in MacOS due to significant overuse of registers resulting in 'register spilling' where data that would normally be stored in registers on the GPU is instead stored in VRAM. The latency to read from/write to VRAM instead of registers incurs a significant performance penalty.
- Use of registers is a limiting factor in shader performance. Assignment of a struct from memory to a local variable can incur copies. Passing a variable that has struct type as an argument to a function can also incur copies. As such, these two cases can incur increased register usage and decreased performance.

## Solution

- Remove/avoid a number of assignments of light struct type data to local variables.
- Remove/avoid a number of passing light struct type variables/data as value arguments to shader functions.
2023-01-02 22:07:33 +00:00
..
src bevy_pbr: Avoid copying structs and using registers in shaders (#7069) 2023-01-02 22:07:33 +00:00
Cargo.toml Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00