Solari support on metal backends - #25123
Queued
mate-h wants to merge 9 commits into
Queued
Conversation
stuartparmenter
suggested changes
Jul 22, 2026
stuartparmenter
left a comment
Contributor
There was a problem hiding this comment.
The code changes here all seem right and make sense -- just a few mostly nits
ChristopherBiscardi
approved these changes
Jul 22, 2026
Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
JMS55
suggested changes
Jul 24, 2026
JMS55
left a comment
Contributor
There was a problem hiding this comment.
Functionally lgtm, and I verified it doesn't affect perf on a 5080.
Left some style comments.
JMS55
approved these changes
Jul 27, 2026
stuartparmenter
approved these changes
Jul 27, 2026
JMS55
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Objective
Ray tracing on Metal has been available since wgpu 29.
I shipped a PR to wgpu for implementing bindless storage buffers for metal, which was released with wgpu 30. With the wgpu 30 PR 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
ShaderTypewas tricky. To avoid blowing up memory I put it in a private module so you can't construct it.Testing
Currently this PR needs a benchmark against main to ensure there's no perf regression. I could use some help with that!
Showcase
Known limitations
Tracing spans incorrectly report 0.0ms , tracking in gfx-rs/wgpu#9414
No denoising support yet. Could theoretically use MetalFX Ray Reconstruction 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.