-
Notifications
You must be signed in to change notification settings - Fork 948
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
[wgpu-core] Inline RayQuery Support #3631
Conversation
…y implementation, run cargo clippy, fix wgpu/wgpu build
…me links to implementation resources.
…u into hal-acceleration-structures
+ seperated RAY_QUERY
(better allocation strategy required)
@Vecvec I talked to the wgpu devs btw. If we want this to be merged, what we need is a bunch more tests. Both for happy paths, and to ensure things can't be misused. Devs will be more willing to review and merge this if they can be confident it's working correctly via tests. |
I've fixed merge conflicts here, but the tests fail now: daniel-keitel#3 |
I've been working on fixing use after free crashes (and merged trunk while doing so), and I've encountered a similar problem. I'm happy to know that it is not just something wrong with the changes I've made. This seems, as you suggest, not related to this PR. |
@Vecvec my fails are now just vulkan validation:
|
That's great! What did you change? Also I think that that validation error is similar to #5373, same submitted usage though different prior usage. Edit: actually it has different write barriers, same prior usage. I read the wrong thing. Could this actually be the same issue? |
@Vecvec all my changes are pushed up, this was my last commit: daniel-keitel@67710d7 We might be missing a barrier somewhere, not sure |
I've found the issue, turns out we need to call transition buffers on the tlas instance too (seems like a preexisting issue in ray-tracing). |
I've opened atlv24#1 for the write after write fix. |
I've been working on blas compaction, and it now works! Should I split up the PR for merging (a separate hal PR on wgpu plus an extra PR to this PR) or submit as a single PR? Result is (on my system, this probably changes on different graphics cards) 3840 bytes -> 1152 bytes for ray cube compute example. |
Probably best to to make separate PRs. This PR is already huge, and isn't going to be reviewed until it's cleaned up and has more tests. I don't have the skill to finish it though. The best thing you could do would be to cleanup and finish this PR and work with the wgpu devs to get it reviewed, and then do another PR later for BLAS compaction and other improvements. Entirely up to you though, no pressure for how you want to spend your time :) |
On another note I've been updating my validation layer, and I noticed a new validation error saying that my graphics card does not support f32x4 as a acceleration struct format, so I've had a look at the format features, something that needs validation in wgpu-core. The formats that have a high enough percentage to allow main-stream ray-tracing (>27%) are f32x2 and f32x3 (I've removed all f16s as rust does not have fp16, and nor does wgpu). I'm not sure if f32x2 is worth it as we would still lose some people still, and I'm not sure 2d ray-tracing is very useful. What we could do is require it to be f32x3 saying that |
The repo this PR is based on has not been updated in quite some time (since January 2024, 9 months ago), would it be sensible for me or someone else to create a new PR from one of the repositories that has been merged with trunk? I have an added example and test-case that should bring us closer to being merged. Alternatively, if anyone knows when @daniel-keitel might be back I would be happy to wait for his return. |
I would make a new PR. |
Checklist
cargo clippy
.RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown
if applicable.Future Work
Connections
#1040
Depends on: #3507 (vulkan hal)
Matrix Room Thread
Description
Ray tracing support for wgpu and wgpu-core.
This PR implements support for acceleration structures and ray queries.
It provides a create function each for bottom and top level acceleration structures,
and a build function for the two.
Top level acceleration structures can be used in bind groups.
Shader support is already implemented in naga.
TODO
Testing
Tested with example application (ray-cube) and test.
Needs more tests and examples.