mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
36 lines
1.3 KiB
Rust
36 lines
1.3 KiB
Rust
use wgpu_test::{fail, gpu_test, FailureCase, GpuTestConfiguration, TestParameters};
|
|
|
|
// Create an invalid shader and a compute pipeline that uses it
|
|
// with a default bindgroup layout, and then ask for that layout.
|
|
// Validation should fail, but wgpu should not panic.
|
|
#[gpu_test]
|
|
static PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration = GpuTestConfiguration::new()
|
|
.parameters(
|
|
TestParameters::default()
|
|
// https://github.com/gfx-rs/wgpu/issues/4167
|
|
.expect_fail(FailureCase::always().panic("Pipeline is invalid")),
|
|
)
|
|
.run_sync(|ctx| {
|
|
ctx.device.push_error_scope(wgpu::ErrorFilter::Validation);
|
|
|
|
fail(&ctx.device, || {
|
|
let module = ctx
|
|
.device
|
|
.create_shader_module(wgpu::ShaderModuleDescriptor {
|
|
label: None,
|
|
source: wgpu::ShaderSource::Wgsl("not valid wgsl".into()),
|
|
});
|
|
|
|
let pipeline = ctx
|
|
.device
|
|
.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
|
label: Some("mandelbrot compute pipeline"),
|
|
layout: None,
|
|
module: &module,
|
|
entry_point: "doesn't exist",
|
|
});
|
|
|
|
pipeline.get_bind_group_layout(0);
|
|
});
|
|
});
|