From 1f6b47bd78b7714a7c5fd585cdbc0c9f99e7070a Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Thu, 18 May 2023 15:36:06 -0700 Subject: [PATCH] Quiet warnings Fixes the warnings remaining in the code, which should in turn let us check that in CI. Also checks the optional features, which are easy enough to break. --- .github/workflows/ci.yml | 3 ++- src/engine.rs | 4 +++- src/render.rs | 2 +- src/shaders/preprocess.rs | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 087c986..b31eb12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Install native dependencies run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev - - run: cargo check --workspace + - run: cargo check --workspace + - run: cargo check --features=hot_reload,buffer_labels # --exclude with_bevy # for when bevy has an outdated wgpu version # -Dwarnings # for when we have fixed unused code warnings diff --git a/src/engine.rs b/src/engine.rs index 85a5208..a831fed 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -63,6 +63,7 @@ pub struct BufProxy { #[derive(Copy, Clone, PartialEq, Eq)] pub enum ImageFormat { Rgba8, + #[allow(unused)] Bgra8, } @@ -81,6 +82,7 @@ pub enum ResourceProxy { } pub enum ExternalResource<'a> { + #[allow(unused)] Buf(BufProxy, &'a Buffer), Image(ImageProxy, &'a TextureView), } @@ -800,7 +802,7 @@ impl ResourcePool { fn get_buf( &mut self, size: u64, - name: &'static str, + #[allow(unused)] name: &'static str, usage: BufferUsages, device: &Device, ) -> Buffer { diff --git a/src/render.rs b/src/render.rs index 600aded..24ec41a 100644 --- a/src/render.rs +++ b/src/render.rs @@ -2,7 +2,7 @@ use crate::{ engine::{BufProxy, ImageFormat, ImageProxy, Recording, ResourceProxy}, - shaders::{self, FullShaders}, + shaders::FullShaders, RenderParams, Scene, }; use vello_encoding::{Encoding, WorkgroupSize}; diff --git a/src/shaders/preprocess.rs b/src/shaders/preprocess.rs index bb9ed68..97367b8 100644 --- a/src/shaders/preprocess.rs +++ b/src/shaders/preprocess.rs @@ -5,6 +5,7 @@ use std::{ vec, }; +#[allow(unused)] pub fn get_imports(shader_dir: &Path) -> HashMap { let mut imports = HashMap::new(); let imports_dir = shader_dir.join("shared");