Skip to content

Commit

Permalink
Better error message for unsupported shader features Fixes #869 (#2598)
Browse files Browse the repository at this point in the history
# 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)
```
  • Loading branch information
myisaak committed Aug 13, 2021
1 parent fafee88 commit 5eeba15
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crates/bevy_render/src/shader/shader_reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,19 @@ fn reflect_binding(
filtering: true,
},
),
_ => panic!("Unsupported bind type {:?}.", binding.descriptor_type),
_ => {
let ReflectDescriptorBinding {
descriptor_type,
name,
set,
binding,
..
} = binding;
panic!(
"Unsupported shader bind type {:?} (name '{}', set {}, binding {})",
descriptor_type, name, set, binding
);
}
};

let shader_stage = match shader_stage {
Expand Down

0 comments on commit 5eeba15

Please sign in to comment.