fn create_render_pipeline(
	device: &wgpu::Device,
	layout: &wgpu::PipelineLayout,
	vertex_shader: &wgpu::ShaderModule,
	fragment_shader: &wgpu::ShaderModule,
	swap_chain_format: wgpu::TextureFormat,
) -> wgpu::RenderPipeline {
	device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
		label: Some("show-image-pipeline"),
		layout: Some(&layout),
		vertex: wgpu::VertexState {
			module: &vertex_shader,
			entry_point: "main",
			buffers: &[],
		},
		fragment: Some(wgpu::FragmentState {
			module: &fragment_shader,
			entry_point: "main",
			targets: &[wgpu::ColorTargetState {
				format: swap_chain_format,
				blend: Some(wgpu::BlendState {
					color: wgpu::BlendComponent {
						src_factor: wgpu::BlendFactor::SrcAlpha,
						dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
						operation: wgpu::BlendOperation::Add,
					},
					alpha: wgpu::BlendComponent {
						src_factor: wgpu::BlendFactor::One,
						dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
						operation: wgpu::BlendOperation::Add,
					},
				}),
				write_mask: wgpu::ColorWrite::ALL,
			}],
		}),
		primitive: wgpu::PrimitiveState {
			topology: wgpu::PrimitiveTopology::TriangleList,
			strip_index_format: None,
			front_face: wgpu::FrontFace::Cw,
			cull_mode: Some(wgpu::Face::Back),
			clamp_depth: false,
			polygon_mode: wgpu::PolygonMode::Fill,
			conservative: false,
		},
		depth_stencil: None,
		multisample: wgpu::MultisampleState {
			count: 1,
			mask: !0,
			alpha_to_coverage_enabled: false,
		},
	})
}
/// Create a render pipeline with the specified device, layout, shaders and swap chain format.
Create a render pipeline with the specified device, layout, shaders and swap chain format.
Create a render pipeline with the specified device layout shaders and swap chain format .
fn create_render_pipeline(
	device: &wgpu::Device,
	layout: &wgpu::PipelineLayout,
	vertex_shader: &wgpu::ShaderModule,
	fragment_shader: &wgpu::ShaderModule,
	swap_chain_format: wgpu::TextureFormat,
) -> wgpu::RenderPipeline {
	device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
		label: Some("show-image-pipeline"),
		layout: Some(&layout),
		vertex: wgpu::VertexState {
			module: &vertex_shader,
			entry_point: "main",
			buffers: &[],
		},
		fragment: Some(wgpu::FragmentState {
			module: &fragment_shader,
			entry_point: "main",
			targets: &[wgpu::ColorTargetState {
				format: swap_chain_format,
				blend: Some(wgpu::BlendState {
					color: wgpu::BlendComponent {
						src_factor: wgpu::BlendFactor::SrcAlpha,
						dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
						operation: wgpu::BlendOperation::Add,
					},
					alpha: wgpu::BlendComponent {
						src_factor: wgpu::BlendFactor::One,
						dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
						operation: wgpu::BlendOperation::Add,
					},
				}),
				write_mask: wgpu::ColorWrite::ALL,
			}],
		}),
		primitive: wgpu::PrimitiveState {
			topology: wgpu::PrimitiveTopology::TriangleList,
			strip_index_format: None,
			front_face: wgpu::FrontFace::Cw,
			cull_mode: Some(wgpu::Face::Back),
			clamp_depth: false,
			polygon_mode: wgpu::PolygonMode::Fill,
			conservative: false,
		},
		depth_stencil: None,
		multisample: wgpu::MultisampleState {
			count: 1,
			mask: !0,
			alpha_to_coverage_enabled: false,
		},
	})
}
fn create_render_pipeline ( device : & wgpu :: Device , layout : & wgpu :: PipelineLayout , vertex_shader : & wgpu :: ShaderModule , fragment_shader : & wgpu :: ShaderModule , swap_chain_format : wgpu :: TextureFormat , ) -> wgpu :: RenderPipeline { device . create_render_pipeline ( & wgpu :: RenderPipelineDescriptor { label : Some ( " " ) , layout : Some ( & layout ) , vertex : wgpu :: VertexState { module : & vertex_shader , entry_point : " " , buffers : & [ ] , } , fragment : Some ( wgpu :: FragmentState { module : & fragment_shader , entry_point : " " , targets : & [ wgpu :: ColorTargetState { format : swap_chain_format , blend : Some ( wgpu :: BlendState { color : wgpu :: BlendComponent { src_factor : wgpu :: BlendFactor :: SrcAlpha , dst_factor : wgpu :: BlendFactor :: OneMinusSrcAlpha , operation : wgpu :: BlendOperation :: Add , } , alpha : wgpu :: BlendComponent { src_factor : wgpu :: BlendFactor :: One , dst_factor : wgpu :: BlendFactor :: OneMinusSrcAlpha , operation : wgpu :: BlendOperation :: Add , } , } ) , write_mask : wgpu :: ColorWrite :: ALL , } ] , } ) , primitive : wgpu :: PrimitiveState { topology : wgpu :: PrimitiveTopology :: TriangleList , strip_index_format : None , front_face : wgpu :: FrontFace :: Cw , cull_mode : Some ( wgpu :: Face :: Back ) , clamp_depth : false , polygon_mode : wgpu :: PolygonMode :: Fill , conservative : false , } , depth_stencil : None , multisample : wgpu :: MultisampleState { count : 1 , mask : ! 0 , alpha_to_coverage_enabled : false , } , } ) }
Create a render pipeline with the specified device, layout, shaders and swap chain format.
Create a render pipeline with the specified device layout shaders and swap chain format .
device
&wgpu::Device
layout
&wgpu::PipelineLayout
vertex_shader
&wgpu::ShaderModule
fragment_shader
&wgpu::ShaderModule
swap_chain_format
wgpu::TextureFormat