diff options
Diffstat (limited to 'src/wgpuctx/pipeline.rs')
| -rw-r--r-- | src/wgpuctx/pipeline.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/wgpuctx/pipeline.rs b/src/wgpuctx/pipeline.rs index 7606203..0811800 100644 --- a/src/wgpuctx/pipeline.rs +++ b/src/wgpuctx/pipeline.rs @@ -12,7 +12,9 @@ pub struct RenderPipelineBuilder<'a> vertex_comp_options: Option<wgpu::PipelineCompilationOptions<'a>>, fragment_comp_options: Option<wgpu::PipelineCompilationOptions<'a>>, - vertex_buffer_layouts: Vec<wgpu::VertexBufferLayout<'a>> + vertex_buffer_layouts: Vec<wgpu::VertexBufferLayout<'a>>, + + cull_mode: Option<wgpu::Face> } impl<'a> RenderPipelineBuilder<'a> @@ -30,7 +32,9 @@ impl<'a> RenderPipelineBuilder<'a> vertex_comp_options: None, fragment_comp_options: None, - vertex_buffer_layouts: Vec::new() + vertex_buffer_layouts: Vec::new(), + + cull_mode: Some(wgpu::Face::Back) } } @@ -50,6 +54,13 @@ impl<'a> RenderPipelineBuilder<'a> self } + pub fn cull_mode( + mut self, + mode: Option<wgpu::Face> + ) -> Self { + self.cull_mode = mode; self + } + pub fn build( self, label: Option<&'static str>, @@ -101,7 +112,7 @@ impl<'a> RenderPipelineBuilder<'a> topology: wgpu::PrimitiveTopology::TriangleList, strip_index_format: None, front_face: wgpu::FrontFace::Ccw, - cull_mode: Some(wgpu::Face::Back), + cull_mode: self.cull_mode, polygon_mode: wgpu::PolygonMode::Fill, unclipped_depth: false, conservative: false |
