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:
Adam Gausmann 2021-08-16 13:50:08 -05:00 committed by Dzmitry Malyshau
parent 4dc5546a17
commit ee3b85928e

View File

@ -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(),