Skip to content

Commit

Permalink
[wgpu-hal] Inline RayQuery Support (gfx-rs#3507)
Browse files Browse the repository at this point in the history
Co-authored-by: JMS55 <[email protected]>
Co-authored-by: Ashley Ruglys <[email protected]>
Co-authored-by: Connor Fitzgerald <[email protected]>
  • Loading branch information
4 people authored and bradwerth committed Dec 8, 2023
1 parent fa172e1 commit 6f75c54
Show file tree
Hide file tree
Showing 27 changed files with 2,351 additions and 10 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,20 @@ By @cwfitzgerald in [#3671](https://github.com/gfx-rs/wgpu/pull/3671).
- 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)
- On Web, `Instance::create_surface_from_canvas()` and `create_surface_from_offscreen_canvas()` now take the canvas by value. By @daxpedda in [#3690](https://github.com/gfx-rs/wgpu/pull/3690)

### 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 @@ -341,6 +341,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/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,7 @@ impl<A: HalApi> Device<A> {
},
)
}
Bt::AccelerationStructure => todo!(),
};

// Validate the count parameter
Expand Down Expand Up @@ -2140,6 +2141,7 @@ impl<A: HalApi> Device<A> {
buffers: &hal_buffers,
samplers: &hal_samplers,
textures: &hal_textures,
acceleration_structures: &[],
};
let raw = unsafe {
self.raw
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ features = ["wgsl-in"]
[dev-dependencies]
cfg-if = "1"
env_logger = "0.10"
glam = "0.24.2" # for ray-traced-triangle example
winit = { version = "0.29.4", features = [
"android-native-activity",
] } # for "halmark" example
Expand Down
2 changes: 2 additions & 0 deletions wgpu-hal/examples/halmark/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,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 @@ -475,6 +476,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

0 comments on commit 6f75c54

Please sign in to comment.