diff options
| -rw-r--r-- | crates/teleia/Cargo.toml | 2 | ||||
| -rw-r--r-- | crates/teleia/src/assets/shaders/common/frag.glsl | 2 | ||||
| -rw-r--r-- | crates/teleia/src/context.rs | 2 | ||||
| -rw-r--r-- | crates/teleia/src/shader.rs | 5 | ||||
| -rw-r--r-- | crates/teleia/src/state.rs | 9 |
5 files changed, 17 insertions, 3 deletions
diff --git a/crates/teleia/Cargo.toml b/crates/teleia/Cargo.toml index 18718a4..290a977 100644 --- a/crates/teleia/Cargo.toml +++ b/crates/teleia/Cargo.toml @@ -49,4 +49,4 @@ glfw = { git = "https://github.com/lcolonq/glfw-rs", features = ["serde"] } # wi kira = { version = "=0.9.6", default-features = false, features = ["cpal", "ogg", "wav"] } # audio directories = { git = "https://github.com/lcolonq/directories-rs" } # standard system directories polling = "*" # interface to epoll -tungstenite = { version = "*", features = ["native-tls"] } # websockets
\ No newline at end of file +tungstenite = { version = "0.24.0", features = ["native-tls"] } # websockets
\ No newline at end of file diff --git a/crates/teleia/src/assets/shaders/common/frag.glsl b/crates/teleia/src/assets/shaders/common/frag.glsl index 26d63fa..eb38a19 100644 --- a/crates/teleia/src/assets/shaders/common/frag.glsl +++ b/crates/teleia/src/assets/shaders/common/frag.glsl @@ -113,7 +113,7 @@ vec3 compute_lighting(vec3 normal) { shadow_vector[i].x *= -1.0; } - // cannot only index array of samplers with a constant, hence the weird setup + // can only index array of samplers with a constant, hence the weird setup #define SAMPLE_SHADOW(n) n < light_count ? texture(light_shadowbuffer_point[n], shadow_vector[n]).r : 1.0 float shadow_depth[5]; shadow_depth[0] = SAMPLE_SHADOW(0); diff --git a/crates/teleia/src/context.rs b/crates/teleia/src/context.rs index 28ca2bf..4bcdea0 100644 --- a/crates/teleia/src/context.rs +++ b/crates/teleia/src/context.rs @@ -101,6 +101,8 @@ impl Context { self.gl.clear_color(0.1, 0.1, 0.1, 1.0); self.gl.clear_depth_f32(1.0); + self.gl.enable(glow::DEBUG_OUTPUT); + self.gl.enable(glow::DEPTH_TEST); self.gl.depth_func(glow::LEQUAL); diff --git a/crates/teleia/src/shader.rs b/crates/teleia/src/shader.rs index 610e1ba..b45e31e 100644 --- a/crates/teleia/src/shader.rs +++ b/crates/teleia/src/shader.rs @@ -83,7 +83,10 @@ impl Shader { } pub fn new_nolib(ctx: &context::Context, vsrc: &str, fsrc: &str) -> Self { - Self::new_helper(ctx, vsrc, fsrc).expect("failed to load shader") + match Self::new_helper(ctx, vsrc, fsrc) { + Ok(x) => x, + Err(e) => panic!("failed to load no-library shader: {}", e) + } } pub fn new(ctx: &context::Context, vsrcstr: &str, fsrcstr: &str) -> Self { diff --git a/crates/teleia/src/state.rs b/crates/teleia/src/state.rs index 5bec34e..46b46b1 100644 --- a/crates/teleia/src/state.rs +++ b/crates/teleia/src/state.rs @@ -2,6 +2,7 @@ use std::{collections::HashMap, fmt::Display}; use bimap::BiHashMap; use enum_map::{enum_map, Enum, EnumMap}; +use glow::HasContext; use serde::{Serialize, Deserialize}; use strum::EnumIter; @@ -533,6 +534,14 @@ impl State { self.shader_upscale.bind(&ctx); self.render_framebuffer.bind_texture(&ctx); ctx.render_no_geometry(); + let err = unsafe { ctx.gl.get_error() }; + if err != glow::NO_ERROR { + log::warn!("opengl error: {}", err); + } + let log = unsafe { ctx.gl.get_debug_message_log(5) }; + for m in log { + log::warn!("opengl debug message: {:?}", m); + } Ok(()) } } |
