Skip to content

Commit e8fc279

Browse files
authored
Fix non-meshlet shaders for non-bindless mode (#16966)
# Objective - Running example `load_gltf` when not using bindless gives this error ``` ERROR bevy_render::render_resource::pipeline_cache: failed to process shader: error: no definition in scope for identifier: 'slot' ┌─ crates/bevy_pbr/src/render/pbr_fragment.wgsl:153:13 │ 153 │ slot, │ ^^^^ unknown identifier │ = no definition in scope for identifier: 'slot' ``` - since #16825 ## Solution - Set `slot` to the expected value when not mindless - Also use it for `uv_b` ## Testing - Run example `load_gltf` on a Mac or in wasm
1 parent f9c8f51 commit e8fc279

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/bevy_pbr/src/render/pbr_fragment.wgsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ fn pbr_input_from_standard_material(
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;
8384
let flags = pbr_bindings::material.flags;
8485
let base_color = pbr_bindings::material.base_color;
8586
let deferred_lighting_pass_id = pbr_bindings::material.deferred_lighting_pass_id;
@@ -171,7 +172,7 @@ fn pbr_input_from_standard_material(
171172
// parallax mapping algorithm easier to understand and reason
172173
// about.
173174
-Vt,
174-
in.instance_index,
175+
slot,
175176
);
176177
#else
177178
uv_b = uv;

0 commit comments

Comments
 (0)