mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-10-30 14:01:39 +00:00
parent
27f2ce397a
commit
3666f1aef8
37
tests/tests/pipeline.rs
Normal file
37
tests/tests/pipeline.rs
Normal file
@ -0,0 +1,37 @@
|
||||
use wasm_bindgen_test::*;
|
||||
use wgpu_test::{fail, initialize_test, FailureCase, TestParameters};
|
||||
|
||||
#[test]
|
||||
#[wasm_bindgen_test]
|
||||
fn pipeline_default_layout_bad_module() {
|
||||
// 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.
|
||||
let parameters = TestParameters::default()
|
||||
.skip(FailureCase::webgl2())
|
||||
// https://github.com/gfx-rs/wgpu/issues/4167
|
||||
.expect_fail(FailureCase::always());
|
||||
initialize_test(parameters, |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);
|
||||
});
|
||||
});
|
||||
}
|
@ -19,6 +19,7 @@ mod external_texture;
|
||||
mod instance;
|
||||
mod occlusion_query;
|
||||
mod partially_bounded_arrays;
|
||||
mod pipeline;
|
||||
mod poll;
|
||||
mod query_set;
|
||||
mod queue_transfer;
|
||||
|
Loading…
Reference in New Issue
Block a user