fmenozzi / shadertoy-rs

A desktop client for Shadertoy written in Rust
MIT License
69 stars 10 forks source link

NoAvailablePixelFormat Error #31

Open AnnanFay opened 8 months ago

AnnanFay commented 8 months ago

Builds fine but attempting to run any shader crashes. System is windows 10. AMD Radeon RX 6700 XT. Same behaviour in non-release mode.

PS F:\repos\shadertoy-rs> cargo run --release -- --example seascape
    Finished release [optimized] target(s) in 0.26s
warning: the following packages contain code that will be rejected by a future version of Rust: winapi v0.2.8
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 3`
     Running `target\release\shadertoy.exe --example seascape`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', src\runner.rs:133:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\release\shadertoy.exe --example seascape` (exit code: 101)

Full backtrace:

PS F:\repos\shadertoy-rs> $env:RUST_BACKTRACE="full"
PS F:\repos\shadertoy-rs> cargo run --release -- --example seascape
    Finished release [optimized] target(s) in 0.25s
warning: the following packages contain code that will be rejected by a future version of Rust: winapi v0.2.8
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 8`
     Running `target\release\shadertoy.exe --example seascape`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', src\runner.rs:133:14
stack backtrace:
   0:     0x7ff7680eac3f - std::backtrace_rs::backtrace::dbghelp::trace
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
   1:     0x7ff7680eac3f - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff7680eac3f - std::sys_common::backtrace::_print_fmt
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:66
   3:     0x7ff7680eac3f - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:45
   4:     0x7ff768103dca - core::fmt::write
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\fmt\mod.rs:1197
   5:     0x7ff7680e3309 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\io\mod.rs:1672
   6:     0x7ff7680ed45b - std::sys_common::backtrace::_print
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:48
   7:     0x7ff7680ed45b - std::sys_common::backtrace::print
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:35
   8:     0x7ff7680ed45b - std::panicking::default_hook::closure$1
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:295
   9:     0x7ff7680ed0db - std::panicking::default_hook
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:314
  10:     0x7ff7680eda09 - std::panicking::rust_panic_with_hook
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:698
  11:     0x7ff7680ed90d - std::panicking::begin_panic_handler::closure$0
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:588
  12:     0x7ff7680eb5c7 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:138
  13:     0x7ff7680ed5e9 - std::panicking::begin_panic_handler
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:584
  14:     0x7ff76811ec05 - core::panicking::panic_fmt
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\panicking.rs:142
  15:     0x7ff76811ed13 - core::result::unwrap_failed
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\result.rs:1805
  16:     0x7ff767d6d848 - shadertoy::runner::run::he03f289bb0b2e8db
  17:     0x7ff767d45aad - <gfx::pso::resource::TextureSampler<T> as gfx::pso::DataBind<R>>::bind_to::h56bbc29c1a81b56a
  18:     0x7ff767d48df6 - std::sys_common::backtrace::__rust_begin_short_backtrace::hec2391bab7f568d7
  19:     0x7ff767d5098c - std::rt::lang_start::{{closure}}::hfda90fc685594d49
  20:     0x7ff7680dcd31 - core::ops::function::impls::impl$2::call_once
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\ops\function.rs:280
  21:     0x7ff7680dcd31 - std::panicking::try::do_call
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:492
  22:     0x7ff7680dcd31 - std::panicking::try
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:456
  23:     0x7ff7680dcd31 - std::panic::catch_unwind
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panic.rs:137
  24:     0x7ff7680dcd31 - std::rt::lang_start_internal::closure$2
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\rt.rs:128
  25:     0x7ff7680dcd31 - std::panicking::try::do_call
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:492
  26:     0x7ff7680dcd31 - std::panicking::try
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:456
  27:     0x7ff7680dcd31 - std::panic::catch_unwind
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panic.rs:137
  28:     0x7ff7680dcd31 - std::rt::lang_start_internal
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\rt.rs:128
  29:     0x7ff767d45bf7 - main
  30:     0x7ff76810b84c - invoke_main
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  31:     0x7ff76810b84c - __scrt_common_main_seh
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  32:     0x7fff4f327344 - BaseThreadInitThunk
  33:     0x7fff4f4626b1 - RtlUserThreadStart
error: process didn't exit successfully: `target\release\shadertoy.exe --example seascape` (exit code: 101)
fmenozzi commented 8 months ago

What version of OpenGL are you running? Do previous versions of shadertoy-rs run correctly? If you're familiar with git bisect you could try to see if earlier versions work. But my guess based on the error is that glutin queried your system for the configuration needed and some aspect of it is not supported on your system. You could try passing the --force_srgb_off flag to shadertoy-rs to see if disabling sRGB works. Otherwise it's possible that updating glutin and/or related dependencies to newer versions might solve the issue. Unfortunately I do not have access to a Windows machine so I can't really debug much more beyond that on my end :/