use wgpu::{include_wgsl, RenderPipeline}; pub fn new(device: &wgpu::Device, config: &wgpu::SurfaceConfiguration) -> RenderPipeline { let sky_shader = device.create_shader_module(include_wgsl!("../shaders/sky.wgsl")); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Sky Render Pipeline Layout"), bind_group_layouts: &[], push_constant_ranges: &[], }); let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { label: Some("Sky Render Pipeline"), layout: Some(&render_pipeline_layout), vertex: wgpu::VertexState { module: &sky_shader, entry_point: "vs_main", buffers: &[], }, primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, strip_index_format: None, front_face: wgpu::FrontFace::Ccw, conservative: false, cull_mode: None, unclipped_depth: false, polygon_mode: wgpu::PolygonMode::Fill, }, depth_stencil: None, multisample: wgpu::MultisampleState { count: 1, mask: !0, alpha_to_coverage_enabled: false, }, fragment: Some(wgpu::FragmentState { module: &sky_shader, entry_point: "fs_main", targets: &[Some(wgpu::ColorTargetState { format: config.format, blend: Some(wgpu::BlendState::REPLACE), write_mask: wgpu::ColorWrites::ALL, })], }), multiview: None, }); return render_pipeline; }