summaryrefslogtreecommitdiff
path: root/src/shader.rs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-04-13 20:34:28 -0400
committerLLLL Colonq <llll@colonq>2024-04-13 20:34:28 -0400
commitf0b945d378a157a780f56b1fc015b7937e151852 (patch)
tree3caddd259ad14a225cd3984726b3d44bac8b6d4a /src/shader.rs
parent17eb85df48b64dd9d391cad28f58355e05ed2855 (diff)
Bugfixes, texture filtering
Diffstat (limited to 'src/shader.rs')
-rw-r--r--src/shader.rs10
1 files changed, 7 insertions, 3 deletions
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);
+ }
}
}