mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Fix panic in GLES shader processing
The backend panics while trying to process uniform global variables when the variable's name is not found in the emitted ReflectionInfo. This patch converts the panicking line into an explicit check, and ignores the corresponding global variable if the name iis not found. Resolves #1803
This commit is contained in:
parent
4dc5546a17
commit
ee3b85928e
@ -35,7 +35,10 @@ impl CompilationContext<'_> {
|
||||
let br = var.binding.as_ref().unwrap();
|
||||
let slot = self.layout.get_slot(br);
|
||||
|
||||
let name = reflection_info.uniforms[&handle].clone();
|
||||
let name = match reflection_info.uniforms.get(&handle) {
|
||||
Some(name) => name.clone(),
|
||||
None => continue,
|
||||
};
|
||||
log::debug!(
|
||||
"Rebind buffer: {:?} -> {}, register={:?}, slot={}",
|
||||
var.name.as_ref(),
|
||||
|
Loading…
Reference in New Issue
Block a user