Skip to content

Commit 6f75c54

Browse files
daniel-keitelJMS55expensescwfitzgerald
authored andcommitted
[wgpu-hal] Inline RayQuery Support (gfx-rs#3507)
Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com> Co-authored-by: Ashley Ruglys <ashley.ruglys@gmail.com> Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
1 parent fa172e1 commit 6f75c54

File tree

27 files changed

+2351
-10
lines changed

27 files changed

+2351
-10
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,20 @@ By @cwfitzgerald in [#3671](https://github.com/gfx-rs/wgpu/pull/3671).
716716
- 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)
717717
- 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)
718718

719+
### Added/New Features
720+
721+
#### General
722+
- 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)
723+
724+
#### Vulkan
725+
726+
- 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)
727+
728+
#### Hal
729+
730+
- 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)
731+
732+
719733
### Changes
720734

721735
#### General

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wgpu-core/src/binding_model.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ impl BindingTypeMaxCountValidator {
341341
wgt::BindingType::StorageTexture { .. } => {
342342
self.storage_textures.add(binding.visibility, count);
343343
}
344+
wgt::BindingType::AccelerationStructure => todo!(),
344345
}
345346
}
346347

wgpu-core/src/device/resource.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,7 @@ impl<A: HalApi> Device<A> {
16461646
},
16471647
)
16481648
}
1649+
Bt::AccelerationStructure => todo!(),
16491650
};
16501651

16511652
// Validate the count parameter
@@ -2140,6 +2141,7 @@ impl<A: HalApi> Device<A> {
21402141
buffers: &hal_buffers,
21412142
samplers: &hal_samplers,
21422143
textures: &hal_textures,
2144+
acceleration_structures: &[],
21432145
};
21442146
let raw = unsafe {
21452147
self.raw

wgpu-hal/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ features = ["wgsl-in"]
169169
[dev-dependencies]
170170
cfg-if = "1"
171171
env_logger = "0.10"
172+
glam = "0.24.2" # for ray-traced-triangle example
172173
winit = { version = "0.29.4", features = [
173174
"android-native-activity",
174175
] } # for "halmark" example

wgpu-hal/examples/halmark/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ impl<A: hal::Api> Example<A> {
442442
buffers: &[global_buffer_binding],
443443
samplers: &[&sampler],
444444
textures: &[texture_binding],
445+
acceleration_structures: &[],
445446
entries: &[
446447
hal::BindGroupEntry {
447448
binding: 0,
@@ -475,6 +476,7 @@ impl<A: hal::Api> Example<A> {
475476
buffers: &[local_buffer_binding],
476477
samplers: &[],
477478
textures: &[],
479+
acceleration_structures: &[],
478480
entries: &[hal::BindGroupEntry {
479481
binding: 0,
480482
resource_index: 0,

0 commit comments

Comments
 (0)