bevy/crates/bevy_pbr/src/render
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
..
clustered_forward.wgsl Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
depth.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
light.rs Allow to reuse the same RenderPass for multiple RenderPhases (#7043) 2023-01-02 21:39:54 +00:00
mesh_bindings.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh_functions.wgsl bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 21:54:40 +00:00
mesh_types.wgsl bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 21:54:40 +00:00
mesh_vertex_output.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh_view_bindings.wgsl Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
mesh_view_types.wgsl Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
mesh.rs Directly extract joints into SkinnedMeshJoints (#6833) 2022-12-20 16:17:05 +00:00
mesh.wgsl bevy_pbr: Fix incorrect and unnecessary normal-mapping code (#5766) 2022-11-03 20:37:32 +00:00
mod.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
pbr_bindings.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
pbr_functions.wgsl bevy_pbr: Avoid copying structs and using registers in shaders (#7069) 2023-01-02 22:07:33 +00:00
pbr_lighting.wgsl bevy_pbr: Avoid copying structs and using registers in shaders (#7069) 2023-01-02 22:07:33 +00:00
pbr_types.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
pbr.wgsl Fix missing sRGB conversion for dithering non-HDR pipelines (#6707) 2022-11-22 15:55:50 +00:00
shadows.wgsl bevy_pbr: Avoid copying structs and using registers in shaders (#7069) 2023-01-02 22:07:33 +00:00
skinning.wgsl bevy_pbr: Normalize skinned normals (#6543) 2022-11-11 03:31:57 +00:00
utils.wgsl Use wgsl saturate (#6318) 2022-10-22 08:37:51 +00:00
wireframe.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00