Upgrade to wgpu 30 - #24841
Conversation
Zeophlite
left a comment
There was a problem hiding this comment.
Approve all but Solaris changes
|
CI is passing except for the building of the integration tests because of the patches. |
|
current status of this PR is waiting for new naga_oil/dlss_wgpu crates to be published to crates.io, so marking as blocked until then for clarity. |
stuartparmenter
left a comment
There was a problem hiding this comment.
All the changes look good. I've been testing Bevy w/ wgpu v30 (and trunk right before v30) for the last 6 weeks or so, and have been doing additional testing moving over to this PR. My game, tests, etc all work fine.
The solari change will have a conflict if #24767 lands first (which it probably will)
|
The example run differences seem to be caused by something on main, where examples like |
Upstream upgraded to wgpu 30 (bevyengine#24841), which contains all of the wgpu HDR work our [patch] pin pointed at (a03be8d2 is an ancestor of v30.0.0), so the git pins are dropped and wgpu/wgpu-types/naga/ wgpu-naga-bridge now resolve to crates.io 30.0.0. Most code conflicts were upstream independently making the same wgpu 30 API migration this branch already carried via the trunk pin; kept our sides where they had more specific expect messages or the HDR surface negotiation, and adopted upstream's present(&RenderQueue) signature. Also removes the two #[expect(clippy::large_enum_variant)] workarounds obsoleted by upstream boxing RenderResources.
# Objective [Ray tracing on Metal](gfx-rs/wgpu#8071) has been available since wgpu 29. I shipped a PR to wgpu for [implementing bindless storage buffers](gfx-rs/wgpu#9081) for metal, which was released with wgpu 30. With the [wgpu 30 PR](bevyengine#24841) in bevy merged, we are fully ready to add support to Solari on metal backends! However because there is a limit of 31 buffer slots per shader stage. Running Solari on main on a raytracing compatible Mac results in a crash. ## Solution I had combine the world cache into a single packed buffer. In theory this should not introduce performance regressions since it’s only reorganizing bindings and doesn’t introduce and copy or other passes. Tried keeping the diff fairly minimal and easy to review. Getting the buffer layout for the world cache on the CPU with `ShaderType` was tricky. To avoid blowing up memory I put it in a private module so you can't construct it. ## Testing - Ran the Solari example on mac ``` cargo run --example solari --features bevy_solari,https,free_camera ``` Currently this PR needs a benchmark against main to ensure there's no perf regression. I could use some help with that! --- ## Showcase <img width="2566" height="1514" alt="shot" src="https://github.com/user-attachments/assets/691b9bd3-129f-47e6-8efe-313cbadd6ff5" /> ## Known limitations Tracing spans incorrectly report 0.0ms , tracking in gfx-rs/wgpu#9414 No denoising support yet. Could theoretically use [MetalFX Ray Reconstruction](https://crates.io/crates/objc2-metal-fx) in place of DLSS for cross-platform denoising support in Solari. In the longer term we are also looking at Open Image Denoise 3.0 that promises temporal denoising support. --------- Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
Objective
Upgrade to wgpu 30
Solution
Relevant Changes
SurfaceTexture::present()has been replaced byQueue::present(surface_texture): Rework rework presentation gfx-rs/wgpu#9361Testing
Showcase
3d_scene on macos
ssao on macos
bevy_city on macos
Solari on Windows 11