bevy/crates/bevy_pbr/src/prepass
Elabajaba 0f5d8128c9
Fix prepass binding issues causing crashes when not all prepass bindings are used (#10788)
# Objective

Fixes https://github.com/bevyengine/bevy/issues/10786

## Solution

The bind_group_layout entries for the prepass were wrong when not all 4
prepass textures were used, as it just zipped [17, 18, 19, 20] with the
smallvec of prepass `bind_group_layout` entries that potentially didn't
contain 4 entries. (eg. if you had a depth and motion vector prepass but
no normal prepass, then depth would be correct but the entry for the
motion vector prepass would be 18 (normal prepass' spot) instead of 19).

Change the prepass `get_bind_group_layout_entries` function to return an
array of `[Option<BindGroupLayoutEntryBuilder>; 4]` and only add the
layout entry if it exists.
2023-11-29 23:11:12 +00:00
..
mod.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
prepass.wgsl prepass vertex shader always outputs world position (#10657) 2023-11-28 12:13:28 +00:00
prepass_bindings.rs Fix prepass binding issues causing crashes when not all prepass bindings are used (#10788) 2023-11-29 23:11:12 +00:00
prepass_bindings.wgsl Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
prepass_io.wgsl pbr shader cleanup (#10105) 2023-10-13 19:12:40 +00:00
prepass_utils.wgsl StandardMaterial Light Transmission (#8015) 2023-10-31 20:59:02 +00:00