diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-04-22 15:40:32 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-04-22 15:40:32 -0400 |
| commit | 25255a8b9147d27aa40b28d6aadb62c0ab275d32 (patch) | |
| tree | 2d2ec324de7c0c16c098d85746ab060edb536f76 /src/wgpuctx/pipeline.rs | |
| parent | 3d3864171785c589872bf23faaaa3a421f56ee4e (diff) | |
| download | systemic4x-25255a8b9147d27aa40b28d6aadb62c0ab275d32.tar.gz systemic4x-25255a8b9147d27aa40b28d6aadb62c0ab275d32.tar.bz2 systemic4x-25255a8b9147d27aa40b28d6aadb62c0ab275d32.zip | |
simplify rendering pipeline. add gridlines to tacmap
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 |
