Skip to content

Commit

Permalink
Add minor ray tracing tests (#6651)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vecvec authored Dec 3, 2024
1 parent eb89f13 commit ed2940d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
- Fix crash when a texture argument is missing. By @aedm in [#6486](https://github.com/gfx-rs/wgpu/pull/6486)
- Emit an error in constant evaluation, rather than crash, in certain cases where `vecN` constructors have less than N arguments. By @ErichDonGubler in [#6508](https://github.com/gfx-rs/wgpu/pull/6508).

### Testing

- Tests the early returns in the acceleration structure build calls with empty calls. By @Vecvec in [#6651](https://github.com/gfx-rs/wgpu/pull/6651).

## 23.0.1 (2024-11-25)

This release includes patches for `wgpu`, `wgpu-core` and `wgpu-hal`. All other crates remain at [23.0.0](https://github.com/gfx-rs/wgpu/releases/tag/v23.0.0).
Expand Down
35 changes: 34 additions & 1 deletion tests/tests/ray_tracing/as_build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::mem;
use std::{iter, mem};

use wgpu::{
util::{BufferInitDescriptor, DeviceExt},
Expand Down Expand Up @@ -283,3 +283,36 @@ fn out_of_order_as_build_use(ctx: TestingContext) {
None,
);
}

#[gpu_test]
static EMPTY_BUILD: GpuTestConfiguration = GpuTestConfiguration::new()
.parameters(
TestParameters::default()
.test_features_limits()
.features(wgpu::Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE),
)
.run_sync(empty_build);
fn empty_build(ctx: TestingContext) {
let mut encoder_safe = ctx
.device
.create_command_encoder(&CommandEncoderDescriptor {
label: Some("BLAS 1"),
});

encoder_safe.build_acceleration_structures(iter::empty(), iter::empty());

let mut encoder_unsafe = ctx
.device
.create_command_encoder(&CommandEncoderDescriptor {
label: Some("BLAS 1"),
});

// # SAFETY:
// we don't actually do anything so all the requirements are satisfied
unsafe {
encoder_unsafe.build_acceleration_structures_unsafe_tlas(iter::empty(), iter::empty());
}

ctx.queue
.submit([encoder_safe.finish(), encoder_unsafe.finish()]);
}

0 comments on commit ed2940d

Please sign in to comment.