diff --git a/assets/voxygen/shaders/ui-frag.glsl b/assets/voxygen/shaders/ui-frag.glsl index ee04285033..a881b2b542 100644 --- a/assets/voxygen/shaders/ui-frag.glsl +++ b/assets/voxygen/shaders/ui-frag.glsl @@ -180,10 +180,6 @@ void main() { // worry about bleeding in the atlas and/or what the border behavior // should be. - // TODO: benchmark before and after by viewing zoomed out map in the UI - // (at particular ui scale and map zoom out, far enough to trigger downscaling) - // (seems like ~10% increase if any) - // Convert to sampled pixel coordinates. vec2 uv_pixel = f_uv * texture_size; vec4 image_color; diff --git a/voxygen/src/render/pipelines/ui.rs b/voxygen/src/render/pipelines/ui.rs index 986bd534c9..ce3e4ef8f4 100644 --- a/voxygen/src/render/pipelines/ui.rs +++ b/voxygen/src/render/pipelines/ui.rs @@ -4,8 +4,6 @@ use core::num::NonZeroU32; use std::mem; use vek::*; -// TODO: profile UI rendering before and after on laptop. - /// The format of textures that the UI sources image data from. /// /// Note, the is not directly used in all relevant locations, but still helps to diff --git a/voxygen/src/render/renderer/drawer.rs b/voxygen/src/render/renderer/drawer.rs index c350e99235..181e52756c 100644 --- a/voxygen/src/render/renderer/drawer.rs +++ b/voxygen/src/render/renderer/drawer.rs @@ -440,7 +440,7 @@ impl<'frame> Drawer<'frame> { /// Runs render passes with alpha premultiplication pipeline to complete any /// pending uploads. - fn run_ui_premultiply_passes<'a>(&mut self) { + fn run_ui_premultiply_passes(&mut self) { prof_span!("run_ui_premultiply_passes"); let Some(premultiply_alpha) = self.borrow.pipelines.premultiply_alpha() else { return }; let encoder = self.encoder.as_mut().unwrap(); diff --git a/voxygen/src/ui/graphic/mod.rs b/voxygen/src/ui/graphic/mod.rs index 53fd4b48f7..ac2276a45a 100644 --- a/voxygen/src/ui/graphic/mod.rs +++ b/voxygen/src/ui/graphic/mod.rs @@ -214,6 +214,7 @@ impl TextureRequirements { } } + #[allow(clippy::wrong_self_convention)] // type is spiritually Copy fn to_key_and_tex_parameters( self, graphic_id: Id, @@ -304,7 +305,7 @@ impl GraphicCache { }; let old_requirements = TextureRequirements::from_graphic(&old); - let new_requirements = TextureRequirements::from_graphic(&new); + let new_requirements = TextureRequirements::from_graphic(new); let should_invalidate = old_requirements == new_requirements && old_requirements.is_some(); // Invalidate if possible or remove from caches. @@ -468,7 +469,7 @@ impl GraphicCache { }, }; - let requirements = TextureRequirements::from_graphic(&graphic)?; + let requirements = TextureRequirements::from_graphic(graphic)?; let (key, texture_parameters) = requirements.to_key_and_tex_parameters(graphic_id, requested_dims_upright); @@ -642,7 +643,7 @@ fn prepare_graphic<'graphic>( // expensive enough to do in the background we would just do it on // the GPU. Could still use `rayon` to parallelize this work, if // needed. - let premultiply_strategy = PremultiplyStrategy::determine(&*rgba_cow); + let premultiply_strategy = PremultiplyStrategy::determine(&rgba_cow); let needs_gpu_premultiply = match premultiply_strategy { PremultiplyStrategy::UseGpu => true, PremultiplyStrategy::NotNeeded => false, @@ -767,7 +768,7 @@ fn upload_image( let size = aabr.size().into_array(); // upload directly renderer.update_texture( - &*target_texture, + target_texture, offset, size, // NOTE: Rgba texture, so each pixel is 4 bytes, ergo this cannot fail. @@ -1044,6 +1045,7 @@ impl PremultiplyStrategy { /// Computes the fraction of 4 pixel chunks that are fully translucent or /// opaque. Returns `None` if no premultiplication is needed (i.e. all alpha /// values are 255). +#[allow(clippy::unusual_byte_groupings)] fn fraction_shortcircuit_blocks(image: &RgbaImage) -> Option { let dims = image.dimensions(); let pixel_count = dims.0 as usize * dims.1 as usize;