pub fn create_pipeline_no_depth(
        &self,
        pipeline_layout: PipelineLayout,
        vertex_layout: VertexLayout,
        blending: Blending,
        shader: Shader,
        tex_format: wgpu::TextureFormat,
        multisample: wgpu::MultisampleState,
        name: Option<&str>
    ) -> Pipeline {
        let vertex_attrs = vertex_layout.to_wgpu();
        let mut b_layouts = Vec::new();

        for s in pipeline_layout.b_layouts.iter() {
            b_layouts.push(&s.wgpu);
        }

        let layout = &self.wgpu.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
            label: name,
            bind_group_layouts: b_layouts.as_slice(),
            push_constant_ranges: &[],
        });

        let (src_factor, dst_factor, operation) = blending.as_wgpu();

        // I like your funny words magic man
        let targets = [wgpu::ColorTargetState {
            format: tex_format,
            blend: Some(wgpu::BlendState {
                color: wgpu::BlendComponent {
                    src_factor,
                    dst_factor,
                    operation
                },
                alpha: wgpu::BlendComponent {
                    src_factor,
                    dst_factor,
                    operation
                },
            }),
            write_mask: wgpu::ColorWrites::ALL,
        }];

        let desc = wgpu::RenderPipelineDescriptor {
            label: name,
            layout: Some(layout),
            vertex: wgpu::VertexState {
                module: &shader.wgpu,
                entry_point: "vs_main",
                buffers: &[vertex_attrs],
            },
            primitive: wgpu::PrimitiveState {
                topology: wgpu::PrimitiveTopology::TriangleList,
                strip_index_format: None,
                front_face: wgpu::FrontFace::Ccw,
                cull_mode: None,
                polygon_mode: wgpu::PolygonMode::Fill,
                unclipped_depth: false,
                conservative: false,
            },
            depth_stencil: None,
            multisample,
            fragment: Some(wgpu::FragmentState {
                module: &shader.wgpu,
                entry_point: "fs_main",
                targets: &targets,
            }),
            multiview: None,
        };

        let wgpu = self.wgpu.create_render_pipeline(&desc);

        Pipeline {
            layout: pipeline_layout,
            vertex_layout,
            wgpu,
        }
    }
/// Create a pipeline without a depth buffer
Create a pipeline without a depth buffer
Create a pipeline without a depth buffer
pub fn create_pipeline_no_depth(
        &self,
        pipeline_layout: PipelineLayout,
        vertex_layout: VertexLayout,
        blending: Blending,
        shader: Shader,
        tex_format: wgpu::TextureFormat,
        multisample: wgpu::MultisampleState,
        name: Option<&str>
    ) -> Pipeline {
        let vertex_attrs = vertex_layout.to_wgpu();
        let mut b_layouts = Vec::new();
        for s in pipeline_layout.b_layouts.iter() {
            b_layouts.push(&s.wgpu);
        }
        let layout = &self.wgpu.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
            label: name,
            bind_group_layouts: b_layouts.as_slice(),
            push_constant_ranges: &[],
        });
        let (src_factor, dst_factor, operation) = blending.as_wgpu();
        // I like your funny words magic man
        let targets = [wgpu::ColorTargetState {
            format: tex_format,
            blend: Some(wgpu::BlendState {
                color: wgpu::BlendComponent {
                    src_factor,
                    dst_factor,
                    operation
                },
                alpha: wgpu::BlendComponent {
                    src_factor,
                    dst_factor,
                    operation
                },
            }),
            write_mask: wgpu::ColorWrites::ALL,
        }];
        let desc = wgpu::RenderPipelineDescriptor {
            label: name,
            layout: Some(layout),
            vertex: wgpu::VertexState {
                module: &shader.wgpu,
                entry_point: "vs_main",
                buffers: &[vertex_attrs],
            },
            primitive: wgpu::PrimitiveState {
                topology: wgpu::PrimitiveTopology::TriangleList,
                strip_index_format: None,
                front_face: wgpu::FrontFace::Ccw,
                cull_mode: None,
                polygon_mode: wgpu::PolygonMode::Fill,
                unclipped_depth: false,
                conservative: false,
            },
            depth_stencil: None,
            multisample,
            fragment: Some(wgpu::FragmentState {
                module: &shader.wgpu,
                entry_point: "fs_main",
                targets: &targets,
            }),
            multiview: None,
        };
        let wgpu = self.wgpu.create_render_pipeline(&desc);
        Pipeline {
            layout: pipeline_layout,
            vertex_layout,
            wgpu,
        }
    }
pub fn create_pipeline_no_depth ( & self , pipeline_layout : PipelineLayout , vertex_layout : VertexLayout , blending : Blending , shader : Shader , tex_format : wgpu :: TextureFormat , multisample : wgpu :: MultisampleState , name : Option < & str > ) -> Pipeline { let vertex_attrs = vertex_layout . to_wgpu ( ) ; let mut b_layouts = Vec :: new ( ) ; for s in pipeline_layout . b_layouts . iter ( ) { b_layouts . push ( & s . wgpu ) ; } let layout = & self . wgpu . create_pipeline_layout ( & wgpu :: PipelineLayoutDescriptor { label : name , bind_group_layouts : b_layouts . as_slice ( ) , push_constant_ranges : & [ ] , } ) ; let ( src_factor , dst_factor , operation ) = blending . as_wgpu ( ) ; // I like your funny words magic man let targets = [ wgpu :: ColorTargetState { format : tex_format , blend : Some ( wgpu :: BlendState { color : wgpu :: BlendComponent { src_factor , dst_factor , operation } , alpha : wgpu :: BlendComponent { src_factor , dst_factor , operation } , } ) , write_mask : wgpu :: ColorWrites :: ALL , } ] ; let desc = wgpu :: RenderPipelineDescriptor { label : name , layout : Some ( layout ) , vertex : wgpu :: VertexState { module : & shader . wgpu , entry_point : " " , buffers : & [ vertex_attrs ] , } , primitive : wgpu :: PrimitiveState { topology : wgpu :: PrimitiveTopology :: TriangleList , strip_index_format : None , front_face : wgpu :: FrontFace :: Ccw , cull_mode : None , polygon_mode : wgpu :: PolygonMode :: Fill , unclipped_depth : false , conservative : false , } , depth_stencil : None , multisample , fragment : Some ( wgpu :: FragmentState { module : & shader . wgpu , entry_point : " " , targets : & targets , } ) , multiview : None , } ; let wgpu = self . wgpu . create_render_pipeline ( & desc ) ; Pipeline { layout : pipeline_layout , vertex_layout , wgpu , } }
Create a pipeline without a depth buffer
Create a pipeline without a depth buffer
&self
pipeline_layout
PipelineLayout
vertex_layout
VertexLayout
blending
Blending
shader
Shader
tex_format
wgpu::TextureFormat
multisample
wgpu::MultisampleState
name
Option<&str>