mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 09:09:19 +01:00
Cherry-pick tests from commit 422b1c3a2c
This commit is contained in:
1 parent
dd93a1a4cc
commit
3896ae0191
3 files changed
+84
No files matched your search
@@ -0,0 +1,36 @@
|
||||
use wgpu::*;
|
||||
use wgpu_test::fail;
|
||||
|
||||
fn check_visibility_requires_mesh_shader_feature(visibility: ShaderStages) {
|
||||
let (device, _queue) = wgpu::Device::noop(&DeviceDescriptor::default());
|
||||
|
||||
fail(
|
||||
&device,
|
||||
|| {
|
||||
device.create_bind_group_layout(&BindGroupLayoutDescriptor {
|
||||
label: Some("mesh shader visibility"),
|
||||
entries: &[BindGroupLayoutEntry {
|
||||
binding: 0,
|
||||
visibility,
|
||||
ty: BindingType::Buffer {
|
||||
ty: BufferBindingType::Storage { read_only: true },
|
||||
has_dynamic_offset: false,
|
||||
min_binding_size: None,
|
||||
},
|
||||
count: None,
|
||||
}],
|
||||
})
|
||||
},
|
||||
Some("EXPERIMENTAL_MESH_SHADER"),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn task_visibility_requires_mesh_shader_feature() {
|
||||
check_visibility_requires_mesh_shader_feature(ShaderStages::TASK);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mesh_visibility_requires_mesh_shader_feature() {
|
||||
check_visibility_requires_mesh_shader_feature(ShaderStages::MESH);
|
||||
}
|
||||
@@ -10,5 +10,7 @@ mod experimental;
|
||||
mod external_texture;
|
||||
mod immediates;
|
||||
mod instance;
|
||||
mod mesh_shader;
|
||||
mod ray_tracing_pipeline;
|
||||
mod render_pipeline;
|
||||
mod texture;
|
||||
@@ -0,0 +1,46 @@
|
||||
use wgpu::*;
|
||||
use wgpu_test::fail;
|
||||
|
||||
fn check_visibility_requires_ray_tracing_pipelines_feature(visibility: ShaderStages) {
|
||||
let (device, _queue) = wgpu::Device::noop(&DeviceDescriptor::default());
|
||||
|
||||
fail(
|
||||
&device,
|
||||
|| {
|
||||
device.create_bind_group_layout(&BindGroupLayoutDescriptor {
|
||||
label: Some("ray tracing pipeline visibility"),
|
||||
entries: &[BindGroupLayoutEntry {
|
||||
binding: 0,
|
||||
visibility,
|
||||
ty: BindingType::Buffer {
|
||||
ty: BufferBindingType::Storage { read_only: true },
|
||||
has_dynamic_offset: false,
|
||||
min_binding_size: None,
|
||||
},
|
||||
count: None,
|
||||
}],
|
||||
})
|
||||
},
|
||||
Some("EXPERIMENTAL_RAY_TRACING_PIPELINES"),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ray_generation_visibility_requires_ray_tracing_pipelines_feature() {
|
||||
check_visibility_requires_ray_tracing_pipelines_feature(ShaderStages::RAY_GENERATION);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn any_hit_visibility_requires_ray_tracing_pipelines_feature() {
|
||||
check_visibility_requires_ray_tracing_pipelines_feature(ShaderStages::ANY_HIT);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closest_hit_visibility_requires_ray_tracing_pipelines_feature() {
|
||||
check_visibility_requires_ray_tracing_pipelines_feature(ShaderStages::CLOSEST_HIT);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn miss_visibility_requires_ray_tracing_pipelines_feature() {
|
||||
check_visibility_requires_ray_tracing_pipelines_feature(ShaderStages::MISS);
|
||||
}
|
||||
Reference in new issue
Block a user