From 25255a8b9147d27aa40b28d6aadb62c0ab275d32 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 22 Apr 2026 15:40:32 -0400 Subject: simplify rendering pipeline. add gridlines to tacmap --- src/wgpuctx/pipeline.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/wgpuctx/pipeline.rs') 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>, fragment_comp_options: Option>, - vertex_buffer_layouts: Vec> + vertex_buffer_layouts: Vec>, + + cull_mode: Option } 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 + ) -> 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 -- cgit v1.2.3