Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello-triangle panics on minimize #1523

Closed
branpk opened this issue Jun 19, 2021 · 3 comments
Closed

hello-triangle panics on minimize #1523

branpk opened this issue Jun 19, 2021 · 3 comments
Labels
api: vulkan Issues with Vulkan area: validation Issues related to validation, diagnostics, and error handling help required We need community help to make this happen. type: bug Something isn't working

Comments

@branpk
Copy link

branpk commented Jun 19, 2021

Description
The hello-triangle example panics after minimizing the window, with the following stack trace:

thread 'main' panicked at 'Index 0 is already occupied', wgpu\wgpu-core\src\hub
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/16e18395ce33ca1ebfe60a591fb2f9317a75d822\/library\std\src\panicking.rs:515
   1: std::panicking::begin_panic_fmt
             at /rustc/16e18395ce33ca1ebfe60a591fb2f9317a75d822\/library\std\src\panicking.rs:457
   2: wgpu_core::hub::Storage<wgpu_core::swap_chain::SwapChain<wgpu_hal::vulkan::Api>, wgpu_core::idswap_chain::SwapChain<wgpu_hal::empty::Api>>>::insert_impl<wgpu_core::swap_chain::SwapChain<wgpu_halgpu_core::id::Id<wgpu_core::s
             at .\wgpu-core\src\hub.rs:162
   3: wgpu_core::hub::Storage<wgpu_core::swap_chain::SwapChain<wgpu_hal::vulkan::Api>, wgpu_core::idswap_chain::SwapChain<wgpu_hal::empty::Api>>>::insert_error<wgpu_core::swap_chain::SwapChain<wgpu_hawgpu_core::id::Id<wgpu_core::
             at .\wgpu-core\src\hub.rs:173
   4: wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>::device_create_swap_chain<wgpu_ityManagerFactory,wgpu_hal::vulkan::Api>
             at .\wgpu-core\src\device\mod.rs:4153
   5: wgpu::backend::direct::{{impl}}::device_create_swap_chain
             at .\wgpu\src\backend\direct.rs:796
   6: wgpu::Device::create_swap_chain
             at .\wgpu\src\lib.rs:1673
   7: hello_triangle::run::{{closure}}::{{closure}}
             at .\wgpu\examples\hello-triangle\main.rs:91

The other examples don't panic, since they use .max(1) before creating the swap chain.

I've seen a few issues that were closed as a dupe of #1026, but this still seems to be present.

Repro steps
Check out latest master, run hello-triangle example.

Expected vs observed behavior
I would expect either:

  • Ideally, creating a zero sized swap chain just works. I know not all back ends support it, but maybe it could be implemented within wgpu.
  • Creating a zero sized swap chain produces a meaningful error message, and the hello-triangle example is updated to use .max(1).

Platform

  • Windows 10
  • AdapterInfo { name: "GeForce GTX 1080 Ti", vendor: 4318, device: 6918, device_type: DiscreteGpu, backend: Vulkan }
  • Latest wgpu master
  • winit 0.24.0
@kvark kvark added area: ecosystem Help the connected projects grow and prosper help required We need community help to make this happen. type: bug Something isn't working labels Jun 20, 2021
@Craig-Macomber
Copy link
Contributor

This does not reproduce on Linux with X11 on Latest wgpu master with winit 0.24.0 on vulkan.
Looks like my window manager does not resize on minimize, and manual window sizing bottoms out at 1x29.

However if I force the size to 0 by 0, I get the same panic as in this issue: "'Index 0 is already occupied', /.../wgpu/wgpu-core/src/hub.rs:172:18"

Therefor I think the repro listed in this issue is not portable, but the issue itself seems to be a general one (bad error message for 0 by 0 swap chains)

@Craig-Macomber
Copy link
Contributor

Craig-Macomber commented Jul 19, 2021

Looking at #1100 it seems like that validation is not working: I do not get the nice error text that commit adds.

After debugging, we do hit that validation correctly, but that error fails to surface, and we get the panic with a worse message instead.

@teoxoy teoxoy added area: validation Issues related to validation, diagnostics, and error handling api: vulkan Issues with Vulkan and removed area: ecosystem Help the connected projects grow and prosper labels Feb 24, 2023
@cwfitzgerald
Copy link
Member

Closing as out of date, this should be fixed.

@cwfitzgerald cwfitzgerald closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vulkan Issues with Vulkan area: validation Issues related to validation, diagnostics, and error handling help required We need community help to make this happen. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants