Skip to content

Commit 232824c

Browse files
authored
Fix meshlets when bindless disabled. (#17770)
# 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.
1 parent 300fe4d commit 232824c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crates/bevy_pbr/src/render/pbr_fragment.wgsl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,16 @@ fn pbr_input_from_standard_material(
7070
in: VertexOutput,
7171
is_front: bool,
7272
) -> pbr_types::PbrInput {
73-
#ifdef BINDLESS
7473
#ifdef MESHLET_MESH_MATERIAL_PASS
7574
let slot = in.material_bind_group_slot;
7675
#else // MESHLET_MESH_MATERIAL_PASS
7776
let slot = mesh[in.instance_index].material_and_lightmap_bind_group_slot & 0xffffu;
7877
#endif // MESHLET_MESH_MATERIAL_PASS
78+
#ifdef BINDLESS
7979
let flags = pbr_bindings::material[slot].flags;
8080
let base_color = pbr_bindings::material[slot].base_color;
8181
let deferred_lighting_pass_id = pbr_bindings::material[slot].deferred_lighting_pass_id;
8282
#else // BINDLESS
83-
let slot = mesh[in.instance_index].material_and_lightmap_bind_group_slot & 0xffffu;
8483
let flags = pbr_bindings::material.flags;
8584
let base_color = pbr_bindings::material.base_color;
8685
let deferred_lighting_pass_id = pbr_bindings::material.deferred_lighting_pass_id;

0 commit comments

Comments
 (0)