Skip to content

Commit ee3b859

Browse files
agausmannkvark
authored andcommitted
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
1 parent 4dc5546 commit ee3b859

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

wgpu-hal/src/gles/device.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ impl CompilationContext<'_> {
3535
let br = var.binding.as_ref().unwrap();
3636
let slot = self.layout.get_slot(br);
3737

38-
let name = reflection_info.uniforms[&handle].clone();
38+
let name = match reflection_info.uniforms.get(&handle) {
39+
Some(name) => name.clone(),
40+
None => continue,
41+
};
3942
log::debug!(
4043
"Rebind buffer: {:?} -> {}, register={:?}, slot={}",
4144
var.name.as_ref(),

0 commit comments

Comments
 (0)