MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / ensure_fill_pipeline

Method ensure_fill_pipeline

src/plot_renderer/shader.rs:794–853  ·  view source on GitHub ↗
(&mut self, device: &Device)

Source from the content-addressed store, hash-verified

792 format: self.format,
793 blend: Some(BlendState::ALPHA_BLENDING),
794 write_mask: ColorWrites::ALL,
795 })],
796 }),
797 primitive: PrimitiveState {
798 topology: PrimitiveTopology::TriangleList,
799 strip_index_format: None,
800 front_face: FrontFace::Ccw,
801 cull_mode: None,
802 polygon_mode: PolygonMode::Fill,
803 unclipped_depth: false,
804 conservative: false,
805 },
806 depth_stencil: None,
807 multisample: msaa_state(),
808 multiview: None,
809 cache: None,
810 });
811 self.pipelines.line = Some(pipeline);
812 }
813
814 pub fn ensure_fill_pipeline(&mut self, device: &Device) {
815 if self.pipelines.fill.is_some() {
816 return;
817 }
818 let shader = device.create_shader_module(include_wgsl!("../shaders/fill.wgsl"));
819 let layout = device.create_pipeline_layout(&PipelineLayoutDescriptor {
820 label: Some("fill layout"),
821 bind_group_layouts: &[&self.camera_bgl],
822 push_constant_ranges: &[],
823 });
824 let pipeline = device.create_render_pipeline(&RenderPipelineDescriptor {
825 label: Some("fill pipeline"),
826 layout: Some(&layout),
827 vertex: VertexState {
828 module: &shader,
829 entry_point: Some("vs_main"),
830 compilation_options: PipelineCompilationOptions::default(),
831 buffers: &[VertexBufferLayout {
832 array_stride: 24,
833 step_mode: VertexStepMode::Vertex,
834 attributes: &[
835 VertexAttribute {
836 offset: 0,
837 shader_location: 0,
838 format: VertexFormat::Float32x2,
839 },
840 VertexAttribute {
841 offset: 8,
842 shader_location: 1,
843 format: VertexFormat::Float32x4,
844 },
845 ],
846 }],
847 },
848 fragment: Some(FragmentState {
849 module: &shader,
850 entry_point: Some("fs_main"),
851 compilation_options: PipelineCompilationOptions::default(),

Callers 1

Calls 1

msaa_stateFunction · 0.85

Tested by

no test coverage detected