summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-03-16 22:27:36 -0400
committerLLLL Colonq <llll@colonq>2026-03-16 22:27:36 -0400
commitff20bccaf90eb83e620e102e7ac7da2db3141148 (patch)
treea25b7c1eb83ef7e95b82b9f7fe2ad4be3f727b05 /crates
parent1a7c2a95c04ab795bc112bd4fd3c9d44c5240497 (diff)
Debug output
Diffstat (limited to 'crates')
-rw-r--r--crates/teleia/Cargo.toml2
-rw-r--r--crates/teleia/src/assets/shaders/common/frag.glsl2
-rw-r--r--crates/teleia/src/context.rs2
-rw-r--r--crates/teleia/src/shader.rs5
-rw-r--r--crates/teleia/src/state.rs9
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(())
}
}