Add minor ray tracing tests (#6651)

This commit is contained in:
Vecvec authored and GitHub committed 2024-12-03 11:25:35 +01:00
1 parent eb89f13928
commit ed2940d869
2 files changed
+38 -1

No files matched your search

+4
View File
@@ -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).
+34 -1
View File
@@ -1,4 +1,4 @@
use std::mem;
use std::{iter, mem};
use wgpu::{
util::{BufferInitDescriptor, DeviceExt},
@@ -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()]);
}