binocle: Command encoder released without endEncoding - Validation error in wgpu on Win10, macOS 10.15, Debian 11

[2021-10-03T21:36:28Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `pixels_command_encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters

', C:\Users\<user>\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.10.2\src\backend\direct.rs:2160:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Anything I can help with to diagnose the problem?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 24 (17 by maintainers)

Most upvoted comments

Thank you for reporting this. I don’t have a (native) Windows or MacOS system to test. I kind of just hoped that the binaries would work.

Any help would be very much appreciated.

The error seems to originate from wgpu (https://github.com/gfx-rs/wgpu/blob/76bcd9c494a4359853bc2caec8eebbaa990a34e3/wgpu-core/src/command/draw.rs#L92-L93, https://github.com/gfx-rs/wgpu/blob/76bcd9c494a4359853bc2caec8eebbaa990a34e3/wgpu-core/src/command/render.rs#L1221-L1227). There are a few (possibly) related issues on GitHub (e.g. https://github.com/iced-rs/iced/issues/816).

It might have to do with the absolute WIDTH/HEIGHT parameters (and the actual screen size?) that are set for binocle here: https://github.com/sharkdp/binocle/blob/db70c421c16fc528097559bea68a616b12a7906c/src/settings.rs#L3-L4

Maybe someone could test setting them to other (lower?) values like 800x600?

Thank you! I’m going to close this for now.

Works on macOS! 🚀

Tried it with an uploaded binary from the releases on Windows (x68_64) and now it works.

awesome. thank you!

Could someone on MacOS verify if this fixes the problem as well?

Could you publish on crates.io please, as well?

Done

I released a new version if someone else wants to give this a try: https://github.com/sharkdp/binocle/releases/tag/v0.1.2

Tried it with an uploaded binary from the releases on Windows (x68_64) and now it works.

Could you publish on crates.io please, as well?

Could someone please try to run this minimal example here: https://github.com/parasyte/pixels/tree/master/examples/egui-winit? This is what binocle is based on. This should allow us to see if I did something wrong in this project. Or if it’s a more fundamental issue.

It works for me. (Tested on Win10 19043)

This also occurs on macOS 10.15.

Here is the full backtrace:

[2021-10-04T07:42:51Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by: In a RenderPass note: encoder = pixels_command_encoder In a set_scissor_rect command Invalid ScissorRect parameters

‘, /Users/rhysd/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.10.2/src/backend/direct.rs:2160:5 stack backtrace: 0: 0x101404ec4 - std::backtrace_rs::backtrace::libunwind::trace::hd9b9204470182ffc at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/…/…/backtrace/src/backtrace/libunwind.rs:90:5 1: 0x101404ec4 - std::backtrace_rs::backtrace::trace_unsynchronized::hdc48b9180be04761 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/…/…/backtrace/src/backtrace/mod.rs:66:5 2: 0x101404ec4 - std::sys_common::backtrace::_print_fmt::h8824de041faf4112 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:67:5 3: 0x101404ec4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d168763f08a78b9 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:46:22 4: 0x1014226ec - core::fmt::write::h0fa46d4891ed63f1 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/fmt/mod.rs:1115:17 5: 0x1014026fa - std::io::Write::write_fmt::hacbf9e10e17149ce at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/io/mod.rs:1665:15 6: 0x101406aff - std::sys_common::backtrace::_print::h26213154a400cfbe at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:49:5 7: 0x101406aff - std::sys_common::backtrace::print::h0f4ab60f53d1f93b at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:36:9 8: 0x101406aff - std::panicking::default_hook::{{closure}}::hee7cf38dedfa76fc at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:208:50 9: 0x1014065fd - std::panicking::default_hook::hd12252412832a45f at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:225:9 10: 0x101407200 - std::panicking::rust_panic_with_hook::h521fd09e07057893 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:622:17 11: 0x101406ca5 - std::panicking::begin_panic_handler::{{closure}}::h3588a5a9cca9e8e5 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:519:13 12: 0x101405368 - std::sys_common::backtrace::__rust_end_short_backtrace::h86522c151a195ff9 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18 13: 0x101406c0a - rust_begin_unwind at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5 14: 0x10144726b - std::panicking::begin_panic_fmt::hf4ebaa1b90291b0b at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:457:5 15: 0x1013194ea - wgpu::backend::direct::default_error_handler::h08482503387f1c2b 16: 0x101311dd0 - core::ops::function::Fn::call::h220f0700d3201d9c 17: 0x101318e5d - <wgpu::backend::direct::Context as wgpu::Context>::command_encoder_end_render_pass::h36c07df2e4f51019 18: 0x10120ac1a - egui_wgpu_backend::RenderPass::execute::h287c71719488f6c5 19: 0x101134aac - binocle::gui::Gui::render::h9856efccf79f8e5e 20: 0x10112f0c9 - pixels::Pixels::render_with::he327fc2f8585b841 21: 0x10112c1ba - binocle::event_loop::run::{{closure}}::hc8ed2fffdf86aef8 22: 0x10112d147 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::he574fa2556b453a2 23: 0x1012a6bc1 - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::h4e84ce779f567612 24: 0x1012a8c95 - winit::platform_impl::platform::app_state::AppState::cleared::h6028c81bcc2db529 25: 0x1012ab4e7 - winit::platform_impl::platform::observer::control_flow_end_handler::h7a06aff7e3095726 26: 0x7fff306b8e15 - ___CFRunLoopDoBlocks 27: 0x7fff306b8d47 - ___CFRunLoopDoBlocks 28: 0x7fff306b840c - ___CFRunLoopRun 29: 0x7fff306b791e - ___CFRunLoopModeIsEmpty 30: 0x7fff2f2e3abd - _RunCurrentEventLoopInMode 31: 0x7fff2f2e37d5 - _ReceiveNextEventCommon 32: 0x7fff2f2e3579 - __BlockUntilNextEventMatchingListInModeWithFilter 33: 0x7fff2d92a039 - __DPSNextEvent 34: 0x7fff2d928880 - -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 35: 0x7fff2d91a58e - -[NSApplication run] 36: 0x1011287aa - winit::platform_impl::platform::event_loop::EventLoop<T>::run::hba1aaae693440197 37: 0x101161573 - winit::event_loop::EventLoop<T>::run::hbdac6e9748eaa26c 38: 0x10116334c - binocle::event_loop::run::h1f98f2568edf9566 39: 0x101165519 - binocle::main::hdb07d61fbb325595 40: 0x101134cfa - std::sys_common::backtrace::__rust_begin_short_backtrace::h20a7982cfa28de2d 41: 0x10115e991 - std::rt::lang_start::{{closure}}::h55274b420cef70fe 42: 0x101407729 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h5adc1669b25f044b at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:259:13 43: 0x101407729 - std::panicking::try::do_call::h405f88a3fec16587 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40 44: 0x101407729 - std::panicking::try::h86d9af92fb3c6022 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19 45: 0x101407729 - std::panic::catch_unwind::h67150880d2b87901 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14 46: 0x101407729 - std::rt::lang_start_internal::{{closure}}::h548e43d03023c928 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:48 47: 0x101407729 - std::panicking::try::do_call::h1383affbfec23244 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40 48: 0x101407729 - std::panicking::try::hf51149bda74e8587 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19 49: 0x101407729 - std::panic::catch_unwind::h8280208a4f5e7cf4 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14 50: 0x101407729 - std::rt::lang_start_internal::h5f9b030f0a63c040 at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:20 51: 0x101165639 - _main -[_MTLCommandEncoder dealloc]:70: failed assertion `Command encoder released without endEncoding’ [1] 90145 abort RUST_BACKTRACE=full binocle target/debug/fixred

I also tried the head of branch db70c421c16fc528097559bea68a616b12a7906c and confirmed the same error building in both release and debug mode.