Skip to content

Commit 5eeba15

Browse files
committed
Better error message for unsupported shader features Fixes #869 (#2598)
# Objective - Provides more useful error messages when using unsupported shader features. ## Solution Fixes #869 - Provided a error message as follows (adding name, set and binding): ``` Unsupported shader bind type CombinedImageSampler (name noiseVol0, set 0, binding 9) ```
1 parent fafee88 commit 5eeba15

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

crates/bevy_render/src/shader/shader_reflect.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,19 @@ fn reflect_binding(
151151
filtering: true,
152152
},
153153
),
154-
_ => panic!("Unsupported bind type {:?}.", binding.descriptor_type),
154+
_ => {
155+
let ReflectDescriptorBinding {
156+
descriptor_type,
157+
name,
158+
set,
159+
binding,
160+
..
161+
} = binding;
162+
panic!(
163+
"Unsupported shader bind type {:?} (name '{}', set {}, binding {})",
164+
descriptor_type, name, set, binding
165+
);
166+
}
155167
};
156168

157169
let shader_stage = match shader_stage {

0 commit comments

Comments
 (0)