Skip to content

Commit

Permalink
Fix meshlets when bindless disabled. (#17770)
Browse files Browse the repository at this point in the history
# Objective

#16966 tried to fix a bug where
`slot` wasn't passed to `parallaxed_uv` when not running under bindless,
but failed to account for meshlets. This surfaces on macOS where
bindless is disabled.

## Solution

Lift the slot variable out of the bindless condition so it's always
available.
  • Loading branch information
tychedelia authored Feb 10, 2025
1 parent 300fe4d commit 232824c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/bevy_pbr/src/render/pbr_fragment.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,16 @@ fn pbr_input_from_standard_material(
in: VertexOutput,
is_front: bool,
) -> pbr_types::PbrInput {
#ifdef BINDLESS
#ifdef MESHLET_MESH_MATERIAL_PASS
let slot = in.material_bind_group_slot;
#else // MESHLET_MESH_MATERIAL_PASS
let slot = mesh[in.instance_index].material_and_lightmap_bind_group_slot & 0xffffu;
#endif // MESHLET_MESH_MATERIAL_PASS
#ifdef BINDLESS
let flags = pbr_bindings::material[slot].flags;
let base_color = pbr_bindings::material[slot].base_color;
let deferred_lighting_pass_id = pbr_bindings::material[slot].deferred_lighting_pass_id;
#else // BINDLESS
let slot = mesh[in.instance_index].material_and_lightmap_bind_group_slot & 0xffffu;
let flags = pbr_bindings::material.flags;
let base_color = pbr_bindings::material.base_color;
let deferred_lighting_pass_id = pbr_bindings::material.deferred_lighting_pass_id;
Expand Down

0 comments on commit 232824c

Please sign in to comment.