From f0b945d378a157a780f56b1fc015b7937e151852 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sat, 13 Apr 2024 20:34:28 -0400 Subject: Bugfixes, texture filtering --- src/shader.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/shader.rs') diff --git a/src/shader.rs b/src/shader.rs index 64ece63..6e58bb7 100644 --- a/src/shader.rs +++ b/src/shader.rs @@ -60,12 +60,16 @@ impl Shader { ctx.gl.detach_shader(program, frag); ctx.gl.delete_shader(frag); + ctx.gl.use_program(Some(program)); + let mut uniforms = HashMap::new(); for index in 0..ctx.gl.get_active_uniforms(program) { if let Some(active) = ctx.gl.get_active_uniform(program, index) { - let loc = ctx.gl.get_uniform_location(program, &active.name) - .expect(&format!("failed to get location for uniform: {}", active.name)); - uniforms.insert(active.name, loc); + if let Some(loc) = ctx.gl.get_uniform_location(program, &active.name) { + uniforms.insert(active.name, loc); + } else { + log::warn!("failed to get location for uniform: {}", active.name); + } } } -- cgit v1.2.3