bevyengine / bevyengine/bevy

Can't close the game window and huge freezes when spawning objects on Dx12 backend

Open
#10,093 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug O-DX12
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

0.11.3

## Relevant system information
```ignore
2023-10-12T08:34:41.201288Z INFO bevy_winit::system: Creating new window "App" (0v0)
2023-10-12T08:34:41.649981Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA TITAN Xp", vendor: 4318, device: 6914, device_type: DiscreteGpu, driver: "", driver_info: "",
backend: Dx12 }
2023-10-12T08:34:42.140647Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 10 Pro", kernel: "19045", cpu: "AMD Ryzen 7 2700X Eight-Core Processor", core_count: "8", memory: "63.9 GiB" }
```

## What you did

Using a Dx12 backend, instead of Vulkan, leads to a window closing problem and freezing problem on my local machine.

## What went wrong

When trying to close the window by pressing the cross or Ctrl-C in the command line, the whole window freezes, stops responding to anything and does not close. It is possible to close the window only by closing the terminal from which the game was launched.

Additionally, when creating 6 cubes the game hangs from 1 to 5 seconds in both debug and release modes.

When switching with powershell env variable to backend 'vulkan' both problems disappear.
When bevy automaticly start with vulkan backend i still cannot close window, but there are no freezing at cube spawns. (without powershell env variable $Env:WGPU_BACKEND="vulkan" before)

## Additional information

It may not be a bevy code related problem but a winit or wgpu problem, however I don't understand how to separate yet.

Bug was on this code
https://github.com/rewin123/frontier-folly/blob/dx12_bug/examples/hypergate_animation_v2.rs

DirectX 12 freeze example
![bad_example](https://github.com/rewin123/frontier-folly/blob/dx12_bug/assets_raw/dx12.gif?raw=true)

Vulkan
![good_example](https://github.com/rewin123/frontier-folly/blob/dx12_bug/assets_raw/vulkan.gif?raw=true)

Contributor guide

Open the contributing guide

Research direction

Start with the linked examples/hypergate_animation_v2.rs and reproduce the issue on the listed Windows 10, NVIDIA TITAN Xp system using the Dx12 and Vulkan backends. Compare window closing and spawning six cubes, then isolate whether the behavior belongs to Bevy, winit, or wgpu; done means both close normally and no multi-second spawn freezes occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.