From 131123842ca4e6f7be8936adb06ff4fc3dcaecc5 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 23 Jun 2022 13:39:37 +0200 Subject: [PATCH] [CLEANUP] Remove useless comment --- src/lib.rs | 13 ------------- src/render/pipelines/utils.rs | 5 ----- 2 files changed, 18 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1a57227..d6ae721 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,20 +70,13 @@ impl model::Vertex for InstanceRaw { use std::mem; wgpu::VertexBufferLayout { array_stride: mem::size_of::() as wgpu::BufferAddress, - // We need to switch from using a step mode of Vertex to Instance - // This means that our shaders will only change to use the next - // instance when the shader starts processing a new instance step_mode: wgpu::VertexStepMode::Instance, attributes: &[ wgpu::VertexAttribute { offset: 0, - // While our vertex shader only uses locations 0, and 1 now, in later tutorials we'll - // be using 2, 3, and 4, for Vertex. We'll start at slot 5 not conflict with them later shader_location: 5, format: wgpu::VertexFormat::Float32x4, }, - // A mat4 takes up 4 vertex slots as it is technically 4 vec4s. We need to define a slot - // for each vec4. We don't have to do this in code though. wgpu::VertexAttribute { offset: mem::size_of::<[f32; 4]>() as wgpu::BufferAddress, shader_location: 6, @@ -123,7 +116,6 @@ impl model::Vertex for InstanceRaw { #[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] struct LightUniform { position: [f32; 3], - // Due to uniforms requiring 16 byte (4 float) spacing, we need to use a padding field here _padding: u32, color: [f32; 3], _padding2: u32, @@ -149,8 +141,6 @@ pub async fn run() { #[cfg(target_arch = "wasm32")] { - // Winit prevents sizing with CSS, so we have to set - // the size manually when on web. use winit::dpi::PhysicalSize; window.set_inner_size(PhysicalSize::new(450, 400)); @@ -210,13 +200,10 @@ pub async fn run() { renderer.update(dt); match renderer.render() { Ok(_) => {} - // Reconfigure the surface if it's lost or outdated Err(wgpu::SurfaceError::Lost | wgpu::SurfaceError::Outdated) => { renderer.resize(renderer.size) } - // The system is out of memory, we should probably quit Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit, - // We're ignoring timeouts Err(wgpu::SurfaceError::Timeout) => log::warn!("Surface timeout"), } } diff --git a/src/render/pipelines/utils.rs b/src/render/pipelines/utils.rs index 3fe2ce5..004dcdb 100644 --- a/src/render/pipelines/utils.rs +++ b/src/render/pipelines/utils.rs @@ -33,11 +33,8 @@ pub fn create_render_pipeline( strip_index_format: None, front_face: wgpu::FrontFace::Ccw, cull_mode: Some(wgpu::Face::Back), - // Setting this to anything other than Fill requires Features::NON_FILL_POLYGON_MODE polygon_mode: wgpu::PolygonMode::Fill, - // Requires Features::DEPTH_CLIP_CONTROL unclipped_depth: false, - // Requires Features::CONSERVATIVE_RASTERIZATION conservative: false, }, depth_stencil: depth_format.map(|format| wgpu::DepthStencilState { @@ -52,8 +49,6 @@ pub fn create_render_pipeline( mask: !0, alpha_to_coverage_enabled: false, }, - // If the pipeline will be used with a multiview render pass, this - // indicates how many array layers the attachments will have. multiview: None, }) }