-
Notifications
You must be signed in to change notification settings - Fork 896
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
Ray Queries #6291
base: trunk
Are you sure you want to change the base?
Ray Queries #6291
Conversation
…u into hal-acceleration-structures
+ seperated RAY_QUERY
(better allocation strategy required)
Co-authored-by: JMS55 <[email protected]>
# Conflicts: # tests/tests/root.rs # wgpu-core/src/command/compute.rs # wgpu-core/src/command/mod.rs # wgpu-core/src/command/ray_tracing.rs # wgpu-core/src/command/render.rs # wgpu-core/src/device/life.rs # wgpu-core/src/device/queue.rs # wgpu-core/src/device/ray_tracing.rs # wgpu-core/src/device/resource.rs # wgpu-core/src/hub.rs # wgpu-core/src/lock/rank.rs # wgpu-core/src/ray_tracing.rs # wgpu-core/src/resource.rs # wgpu-core/src/track/mod.rs # wgpu/src/backend/wgpu_core.rs # wgpu/src/context.rs # wgpu/src/ray_tracing.rs
I'm super excited for this! What makes this PR a draft? What do you think is missing? |
Examples, there is no case for no index buffer (but I'm working on it, hopefully done in a day or so). |
This looks very exciting. This is a pretty large PR and to my knowledge, none of the wgpu maintainers are ray tracing experts. So to facilitate the review process, while we try to ramp up our knowledge of the domain, could you summarize here the context (that is scattered in #1040 and other places)? In particular:
|
To preface this, I came later to this (after most of the design was finalized), so I may not know all of the missing validation, tradeoffs, etc. I will be talking about the safe tlas building (blas building is always safe but there is a extra unsafe function to do unsafe tlas building which might (?) be faster) To my knowledge the only missing pieces of validation are The main tradeoffs are not exposing the scratch buffers because they are harder to validate (possibly) and could cause confusion (especially since most of that is lower level than wgpu provides, and also could be accidently be read back, giving garbage info and leaving the user confused) , which is why in an attempt to mitigate the allocation time blas building and tlas building are unified. This implementation lacks compaction, which was in the initial API design, but needs another HAL function. Procedural geometry (naga needs to implement this, and if most people want to partially support this they will mainly use triangles). I believe there is a full wgpu API (though without ray-tracing pipelines) Extra things to note: this is just for wgpu and wgpu-core, naga support (for ray queries) was added earlier. There is a ray-tracing pipeline that would be nice to have (it could allow a ray-tracer - e.g path-tracer - to be extended). Edit: wgpu-hal support was also added earlier, but only for vulkan (so some things here still have to consider metal and dx12, though dx12 also was considered) The naming is slightly confusing, this might be called ray-tracing, but something that uses this API to create something that simulates light bouncing around a scene might also be said to be ray-tracing (this does not do the second thing). I think that is everything. Tell me if there are other questions about the API. Edit # 2: mostly api is from #1040 (comment) |
…RAY_TRACING_ACCELERATION_STRUCTURE is enabled
I've realised my previous comment requies quite some preexisting raytracing knowledge, so here are the API concepts:
All metal, vulkan, and DXR use roughly these concepts (and they are based on one another). |
I've noticed that a validation fix for spv (in trunk now see #5760) was duplicated in this PR, so I've removed that. (I think this was why gfx-rs/naga was requested for review) |
Connections
Works towards #1040
Description
This PR provides BLASes (bottom level acceleration structures), TLASes (top level acceleration structures), TLAS instances (which contain BLASes and data, like transforms, about them), TLAS packages (which contain vectors of TLAS instances).
Testing
Running tests & examples included in PR
This a updated version of #3631 and is inteanded to replace it.
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.Later (follow-up PR)
as_hal
methods