let render_pipeline_layout = device.create_pipeline_layout(&PipelineLayoutDescriptor {
label: None,
bind_group_layouts: &[Some(&default_bgl), Some(&camera_bgl)],
immediate_size: 0,
});
let shader = device.create_shader_module(include_wgsl!("shaders/shader.wgsl"));
let render_pipeline = device.create_render_pipeline(&RenderPipelineDescriptor {
label: None,
layout: Some(&render_pipeline_layout),
vertex: VertexState {
module: &shader,
entry_point: Some("vs_main"),
buffers: &[],
compilation_options: PipelineCompilationOptions::default(),
},
fragment: Some(FragmentState {
// 3.
module: &shader,
entry_point: Some("fs_main"),
targets: &[Some(ColorTargetState {
// 4.
format: config.format,
blend: Some(BlendState::REPLACE),
write_mask: ColorWrites::ALL,
})],
compilation_options: PipelineCompilationOptions::default(),
}),
primitive: PrimitiveState {
topology: PrimitiveTopology::TriangleList, // 1.
strip_index_format: None,
front_face: FrontFace::Ccw, // 2.
cull_mode: Some(Face::Back),
// Setting this to anything other than Fill requires Features::NON_FILL_POLYGON_MODE
polygon_mode: PolygonMode::Fill,
// Requires Features::DEPTH_CLIP_CONTROL
unclipped_depth: false,
// Requires Features::CONSERVATIVE_RASTERIZATION
conservative: false,
},
depth_stencil: Some(wgpu::DepthStencilState {
format: TextureFormat::Depth32Float,
depth_write_enabled: Some(true), // write new depth values
depth_compare: Some(CompareFunction::Less), // closer to camera wins
stencil: StencilState::default(),
bias: DepthBiasState::default(),
}),
multisample: MultisampleState {
count: 8,
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview_mask: None,
cache: None,
});
thread 'main' (50701) panicked at /home/alpha/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-30.0.1/src/backend/wgpu_core.rs:1414:26:
wgpu error: Validation Error
Caused by:
In Device::create_render_pipeline
Error matching ShaderStages(VERTEX) shader requirements against the pipeline
Shader global ResourceBinding { group: 1, binding: 1 } is not available in the pipeline layout
Binding is missing from the pipeline layout
pretty sure it's available in the pipeline layout