@@ -35,3 +35,46 @@ static PIPELINE_DEFAULT_LAYOUT_BAD_MODULE: GpuTestConfiguration = GpuTestConfigu
3535 pipeline. get_bind_group_layout ( 0 ) ;
3636 } ) ;
3737 } ) ;
38+
39+ const TRIVIAL_VERTEX_SHADER_DESC : wgpu:: ShaderModuleDescriptor = wgpu:: ShaderModuleDescriptor {
40+ label : Some ( "trivial vertex shader" ) ,
41+ source : wgpu:: ShaderSource :: Wgsl ( std:: borrow:: Cow :: Borrowed (
42+ "@vertex fn main() -> @builtin(position) vec4<f32> { return vec4<f32>(0); }" ,
43+ ) ) ,
44+ } ;
45+
46+ #[ gpu_test]
47+ static NO_TARGETLESS_RENDER : GpuTestConfiguration = GpuTestConfiguration :: new ( )
48+ . parameters ( TestParameters :: default ( ) )
49+ . run_sync ( |ctx| {
50+ fail ( & ctx. device , || {
51+ // Testing multisampling is important, because some backends don't behave well if one
52+ // tries to compile code in an unsupported multisample count. Failing to validate here
53+ // has historically resulted in requesting the back end to compile code.
54+ for power_of_two in [ 1 , 2 , 4 , 8 , 16 , 32 , 64 ] {
55+ ctx. device
56+ . create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
57+ label : None ,
58+ layout : None ,
59+ vertex : wgpu:: VertexState {
60+ module : & ctx. device . create_shader_module ( TRIVIAL_VERTEX_SHADER_DESC ) ,
61+ entry_point : "main" ,
62+ compilation_options : Default :: default ( ) ,
63+ buffers : & [ ] ,
64+ } ,
65+ primitive : Default :: default ( ) ,
66+ depth_stencil : None ,
67+ multisample : wgpu:: MultisampleState {
68+ count : power_of_two,
69+ ..Default :: default ( )
70+ } ,
71+ fragment : None ,
72+ multiview : None ,
73+ cache : None ,
74+ } ) ;
75+ }
76+ } )
77+ // TODO: concrete error message:
78+ // At least one color attachment or depth-stencil attachment was expected, but no
79+ // render target for the pipeline was specified.
80+ } ) ;
0 commit comments