darthdeus / comfy

Comfy is a fun 2D game engine built in Rust. It's designed to be opinionated, productive, and easy to use.
https://comfyengine.org
Apache License 2.0
678 stars 28 forks source link

Fragment shader example crashes with "Trying to set a uniform with no shader active" #87

Open caspark opened 5 months ago

caspark commented 5 months ago

Repro:

git checkout master # b0bd254 as of time of report
cargo run --example fragment-shader

Observed: crash with error Trying to set a uniform with no shader active. Stack:

$ RUST_BACKTRACE=1 cargo run --example fragment-shader
   Compiling comfy-core v0.3.0 (/home/ckrieger/srb/comfy/comfy-core)
   Compiling comfy-wgpu v0.3.0 (/home/ckrieger/srb/comfy/comfy-wgpu)
   Compiling comfy v0.3.1 (/home/ckrieger/srb/comfy/comfy)
    Finished dev [optimized + debuginfo] target(s) in 3.81s
     Running `target/debug/examples/fragment-shader`
LOGGER: env_logger
SHADER HOT RELOADING ENABLED!
The application panicked (crashed).
Message:  Trying to set a uniform with no shader active
Location: /home/ckrieger/srb/comfy/comfy-core/src/render_queues.rs:47

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                              ⋮ 8 frames hidden ⋮
10: comfy_core::shaders::set_uniform_f32::h45154c01e11e15e8
    at /home/ckrieger/srb/comfy/comfy-core/src/shaders.rs:98
11: fragment_shader::update::h28c29ba433a930a4
    at /home/ckrieger/srb/comfy/comfy/examples/fragment-shader.rs:78
12: <fragment_shader::ComfyGame as comfy::engine::GameLoop>::update::h61075bfa2401abdf
    at /home/ckrieger/srb/comfy/comfy/src/macros.rs:65
13: comfy::game_loop::run_comfy_main_async::{{closure}}::{{closure}}::h6f61750b0e724056
    at /home/ckrieger/srb/comfy/comfy/src/game_loop.rs:163
20: comfy::game_loop::run_comfy_main_async::{{closure}}::hb484d5d1787cc67d
    at /home/ckrieger/srb/comfy/comfy/src/game_loop.rs:129
21: fragment_shader::run::{{closure}}::hdf9fcd3015104373
    at /home/ckrieger/srb/comfy/comfy/examples/fragment-shader.rs:3
23: fragment_shader::main::hccefd74494084743
    at /home/ckrieger/srb/comfy/comfy/src/macros.rs:33
                              ⋮ 15 frames hidden ⋮

Expected: it doesn't crash :)