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

[wgpu-hal] Initial Vulkan ray tracing pipeline support #3607

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cd16e71
Initial commit
expenses Sep 3, 2022
ae4dcfe
Woo! building an AS works
expenses Sep 11, 2022
98cf75b
Fix alignment for amdpro driver
expenses Sep 11, 2022
6655d23
Ray tracing works in shaders!
expenses Sep 12, 2022
3be84cb
Merge remote-tracking branch 'origin/master' into hal-acceleration-st…
expenses Sep 12, 2022
2cc4385
Major clean up, allow for acceleration structure updates
expenses Sep 15, 2022
cd7c807
Fix trait implementaiton on gles
expenses Sep 15, 2022
4ef32a4
Put larger function call param lists into descriptors for easier dumm…
expenses Sep 15, 2022
8318b5f
Fix wasm build
expenses Sep 15, 2022
fecb538
Shuffle some code around, add a dummy implementation for DX12 with so…
expenses Sep 15, 2022
7905dc5
Add dummy implementation for metal
expenses Sep 16, 2022
e786743
Merge remote-tracking branch 'origin/master' into hal-acceleration-st…
expenses Sep 18, 2022
6f2b07a
Fix example, hopefully have fixed metal code
expenses Sep 18, 2022
9aca7f2
Merge branch 'hal-acceleration-structures' of github.com:expenses/wgp…
expenses Sep 18, 2022
3828af7
Changed surface_format in example.
daniel-keitel Feb 3, 2023
e2de5a3
Changed based on PR 3020#pullrequestreview-1139691697 feedback.
daniel-keitel Feb 3, 2023
112b549
Merge remote-tracking branch 'origin/master' into hal-acceleration-st…
daniel-keitel Feb 21, 2023
074ebe5
unsafe blocks in unsafe functions
daniel-keitel Feb 21, 2023
8ce204b
formatted code
daniel-keitel Feb 21, 2023
f52a70b
added utility functions to AccelerationStructureInstance (bit packing)
daniel-keitel Feb 22, 2023
f15e865
WIP api change build_acceleration_structures
daniel-keitel Feb 27, 2023
a3c0ffb
preperation for changes in get_acceleration_structure_build_sizes
daniel-keitel Feb 28, 2023
a59d888
WIP api change get_acceleration_structure_build_sizes
daniel-keitel Feb 28, 2023
93a347d
added aabbs and geometry flag support
daniel-keitel Mar 1, 2023
16cc4eb
fixed RAY_TRACING feature collision
daniel-keitel Mar 1, 2023
5b84238
renamed to build_acceleration_structure
daniel-keitel Mar 1, 2023
caa4ae7
fixed missing type parameter for metal
daniel-keitel Mar 1, 2023
ca3a54c
Merge remote-tracking branch 'origin/master' into hal-acceleration-st…
daniel-keitel Mar 1, 2023
ca03f34
Merge remote-tracking branch 'origin/master' into hal-acceleration-st…
daniel-keitel Mar 16, 2023
bee8a36
multiple AS builds at once
daniel-keitel Mar 19, 2023
a420b87
switched to using smallvec
daniel-keitel Mar 19, 2023
e48f7bd
small api change + documentation
daniel-keitel Mar 19, 2023
c1dc803
added to changelog
daniel-keitel Mar 19, 2023
b6524af
Added ray tracing pipeline creation to hal (implemented in vulkan, un…
daniel-keitel Mar 20, 2023
5b7cd93
added encoder functions
daniel-keitel Mar 20, 2023
23d3b2d
clippy
daniel-keitel Mar 20, 2023
31d97a8
working example
daniel-keitel Mar 21, 2023
f3fe194
Api changes
daniel-keitel Mar 21, 2023
fe51557
added callable shader to example
daniel-keitel Mar 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ By @teoxoy in [#3534](https://github.com/gfx-rs/wgpu/pull/3534)
- All `fxhash` dependencies have been replaced with `rustc-hash`. By @james7132 in [#3502](https://github.com/gfx-rs/wgpu/pull/3502)
- Change type of `bytes_per_row` and `rows_per_image` (members of `ImageDataLayout`) from `Option<NonZeroU32>` to `Option<u32>`. By @teoxoy in [#3529](https://github.com/gfx-rs/wgpu/pull/3529)

### Added/New Features

#### General
- Added feature flags for ray-tracing (currently only hal): `RAY_QUERY` and `RAY_TRACING` @daniel-keitel (started by @expenses) in [#3507](https://github.com/gfx-rs/wgpu/pull/3507)

#### Vulkan

- Implemented basic ray-tracing api for acceleration structures, and ray-queries @daniel-keitel (started by @expenses) in [#3507](https://github.com/gfx-rs/wgpu/pull/3507)

#### Hal

- Added basic ray-tracing api for acceleration structures, and ray-queries @daniel-keitel (started by @expenses) in [#3507](https://github.com/gfx-rs/wgpu/pull/3507)


### Changes

#### General
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wgpu-core/src/binding_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ impl BindingTypeMaxCountValidator {
wgt::BindingType::StorageTexture { .. } => {
self.storage_textures.add(binding.visibility, count);
}
wgt::BindingType::AccelerationStructure => todo!(),
}
}

Expand Down
2 changes: 2 additions & 0 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,7 @@ impl<A: HalApi> Device<A> {
},
)
}
Bt::AccelerationStructure => todo!(),
};

// Validate the count parameter
Expand Down Expand Up @@ -2202,6 +2203,7 @@ impl<A: HalApi> Device<A> {
buffers: &hal_buffers,
samplers: &hal_samplers,
textures: &hal_textures,
acceleration_structures: &[],
};
let raw = unsafe {
self.raw
Expand Down
3 changes: 2 additions & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ version = "0.11.0"
features = ["wgsl-in"]

[dev-dependencies]
winit = "0.27.1" # for "halmark" example
env_logger = "0.10"
winit = "0.27.1" # for "halmark" example
glam = "0.21.3" # for ray-traced-triangle example # for "halmark" example

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
glutin = "0.29.1" # for "gles" example
2 changes: 2 additions & 0 deletions wgpu-hal/examples/halmark/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ impl<A: hal::Api> Example<A> {
buffers: &[global_buffer_binding],
samplers: &[&sampler],
textures: &[texture_binding],
acceleration_structures: &[],
entries: &[
hal::BindGroupEntry {
binding: 0,
Expand Down Expand Up @@ -465,6 +466,7 @@ impl<A: hal::Api> Example<A> {
buffers: &[local_buffer_binding],
samplers: &[],
textures: &[],
acceleration_structures: &[],
entries: &[hal::BindGroupEntry {
binding: 0,
resource_index: 0,
Expand Down
Loading