Panic when running hello-cube example
mbernat opened this issue · comments
Hi. I'm running into the following issue on the current master (47fa1a9).
➜ harmony git:(master) cargo run --example hello-cube
Compiling harmony v0.1.0 (/home/marek/dev/harmony)
Finished dev [unoptimized + debuginfo] target(s) in 11.36s
Running `target/debug/examples/hello-cube`
[2020-04-26T11:04:11Z WARN gfx_backend_vulkan] Unable to find extension: VK_KHR_wayland_surface
[2020-04-26T11:04:11Z WARN gfx_backend_vulkan] Unable to find layer: VK_LAYER_LUNARG_standard_validation
[2020-04-26T11:04:11Z WARN wgpu_core::device] Requested size 1024x768 is outside of the supported range: Extent2D { width: 1914, height: 1151 }..=Extent2D { width: 1914, height: 1151 }
[2020-04-26T11:04:19Z WARN gfx_memory::heaps] Unable to allocate 134217728 with Linear: TooManyObjects
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `Extent { width: 1024, height: 768, depth: 1 }`,
right: `Extent { width: 1914, height: 1151, depth: 1 }`', <::std::macros::panic macros>:5:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Removing the resize
method from hello-cube.rs
fixes the panic and I can see a nice example with rotating cube.
Hi, thanks for the issue report. Looks like it might be either an issue with how I am using DPI settings on resize or something internal to wgpu:
gfx-rs/wgpu-rs#24
Not able to reproduce on windows or macos. Seems related to linux?
let mut camera_data = CameraData::new_perspective(
70.0,
actual_window_size.width,
Maybe not directly related: The new_perspective fn actually wants Radians. We need to convert .to_radians()
before passing it. Perhaps you changed the fov and it crashed?
Edit:Edit:Missed that you got it working
Thanks for the hints, both of you, I'll try debugging this later today.
Btw, yes, I am on Linux. Would posting some additional traces help?
The issue goes away on the latest master (84969b8).
So I guess it was a wgpu bug.
Closing this as it appears to be fixed.