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

Crash on vulkan when multiple command encoders are used after #5681. #5774

Closed
Elabajaba opened this issue Jun 5, 2024 · 2 comments · Fixed by #5799
Closed

Crash on vulkan when multiple command encoders are used after #5681. #5774

Elabajaba opened this issue Jun 5, 2024 · 2 comments · Fixed by #5799

Comments

@Elabajaba
Copy link
Contributor

Description
Since #5681, wgpu now crashes with "More than one surface texture is being used from the same swapchain. This will cause a deadlock in release." if more than 1 command encoder (with a renderpass that has a texture view of your Surface texture) is used.

Repro steps
Create and submit a 2nd command encoder with a renderpass that uses a view of your surface texture (can create a new texture view or just re-use an existing one) when running on Vulkan.
Run https://github.com/Elabajaba/wgpu-vk-surface-crash

Expected vs observed behavior
Expected: Doesn't crash
Observed:

thread 'main' panicked at E:\temp\wgpu\wgpu-hal\src\vulkan\mod.rs:966:9:
More than one surface texture is being used from the same swapchain. This will cause a deadlock in release.

Platform
Happens on both Windows 11 + AMD gpu and Linux+Mesa RADV (amd) + Wayland.

@Elabajaba Elabajaba changed the title Crash on vulkan and multiple command encoders are used after #5681. Crash on vulkan when multiple command encoders are used after #5681. Jun 5, 2024
@ErichDonGubler
Copy link
Member

@cwfitzgerald indicated he was investigating this last week.

@cwfitzgerald
Copy link
Member

We know the problem, just need to solve it:

If multiple command buffers are involved, the surface texture gets added to the surface texture list in hal::Queue::submit more than once, which is a violation of hal's contract.

github-merge-queue bot pushed a commit to bevyengine/bevy that referenced this issue Jun 13, 2024
Currently blocked on gfx-rs/wgpu#5774

# Objective

Update to wgpu 0.20

## Solution

Update to wgpu 0.20 and naga_oil 0.14.

## Testing

Tested a few different examples on linux (vulkan, webgl2, webgpu) and
windows (dx12 + vulkan) and they worked.

---

## Changelog

- Updated to wgpu 0.20. Note that we don't currently support wgpu's new
pipeline overridable constants, as they don't work on web currently and
need some more changes to naga_oil (and are somewhat redundant with
naga_oil's shader defs). See wgpu's changelog for more
https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#v0200-2024-04-28

## Migration Guide

TODO

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: François Mockers <mockersf@gmail.com>
github-merge-queue bot pushed a commit to bevyengine/bevy that referenced this issue Jun 13, 2024
Currently blocked on gfx-rs/wgpu#5774

# Objective

Update to wgpu 0.20

## Solution

Update to wgpu 0.20 and naga_oil 0.14.

## Testing

Tested a few different examples on linux (vulkan, webgl2, webgpu) and
windows (dx12 + vulkan) and they worked.

---

## Changelog

- Updated to wgpu 0.20. Note that we don't currently support wgpu's new
pipeline overridable constants, as they don't work on web currently and
need some more changes to naga_oil (and are somewhat redundant with
naga_oil's shader defs). See wgpu's changelog for more
https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#v0200-2024-04-28

## Migration Guide

TODO

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: François Mockers <mockersf@gmail.com>
github-merge-queue bot pushed a commit to bevyengine/bevy that referenced this issue Jun 14, 2024
Currently blocked on gfx-rs/wgpu#5774

# Objective

Update to wgpu 0.20

## Solution

Update to wgpu 0.20 and naga_oil 0.14.

## Testing

Tested a few different examples on linux (vulkan, webgl2, webgpu) and
windows (dx12 + vulkan) and they worked.

---

## Changelog

- Updated to wgpu 0.20. Note that we don't currently support wgpu's new
pipeline overridable constants, as they don't work on web currently and
need some more changes to naga_oil (and are somewhat redundant with
naga_oil's shader defs). See wgpu's changelog for more
https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#v0200-2024-04-28

## Migration Guide

TODO

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: François Mockers <mockersf@gmail.com>
mockersf added a commit to bevyengine/bevy that referenced this issue Jun 14, 2024
Currently blocked on gfx-rs/wgpu#5774

# Objective

Update to wgpu 0.20

## Solution

Update to wgpu 0.20 and naga_oil 0.14.

## Testing

Tested a few different examples on linux (vulkan, webgl2, webgpu) and
windows (dx12 + vulkan) and they worked.

---

## Changelog

- Updated to wgpu 0.20. Note that we don't currently support wgpu's new
pipeline overridable constants, as they don't work on web currently and
need some more changes to naga_oil (and are somewhat redundant with
naga_oil's shader defs). See wgpu's changelog for more
https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#v0200-2024-04-28

## Migration Guide

TODO

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: François Mockers <mockersf@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants