Remove extra performance debugging code

This commit is contained in:
Imbris 2022-11-13 21:29:50 -05:00
parent 63096b2042
commit 7205d4c275
3 changed files with 1 additions and 13 deletions

View File

@ -648,10 +648,6 @@ impl PremultiplyUpload {
target_size_xy, target_size_xy,
}) })
} }
pub fn area_dbg(&self) -> f32 {
(self.source_size_xy & 0xFFFF) as f32 * (self.source_size_xy >> 16) as f32
}
} }
use std::sync::Arc; use std::sync::Arc;

View File

@ -445,14 +445,11 @@ impl<'frame> Drawer<'frame> {
let targets = self.borrow.ui_premultiply_uploads.take(); let targets = self.borrow.ui_premultiply_uploads.take();
// TODO: What is the CPU overhead of each renderpass?
for (i, (target_texture, uploads)) in targets.into_iter().enumerate() { for (i, (target_texture, uploads)) in targets.into_iter().enumerate() {
let mut area = 0.0;
prof_span!("ui premultiply pass"); prof_span!("ui premultiply pass");
tracing::info!("{} uploads", uploads.len());
let profile_name = format!("ui_premultiply_pass {}", i); let profile_name = format!("ui_premultiply_pass {}", i);
let label = format!("ui premultiply pass {}", i); let label = format!("ui premultiply pass {}", i);
// TODO: a GPU profile scope on each of the passes here may be a bit too fine // S-TODO: a GPU profile scope on each of the passes here may be a bit too fine
// grained. // grained.
let mut render_pass = let mut render_pass =
encoder.scoped_render_pass(&profile_name, device, &wgpu::RenderPassDescriptor { encoder.scoped_render_pass(&profile_name, device, &wgpu::RenderPassDescriptor {
@ -469,15 +466,12 @@ impl<'frame> Drawer<'frame> {
}); });
render_pass.set_pipeline(&premultiply_alpha.pipeline); render_pass.set_pipeline(&premultiply_alpha.pipeline);
for upload in &uploads { for upload in &uploads {
area += upload.area_dbg();
let (source_bind_group, push_constant_data) = upload.draw_data(&target_texture); let (source_bind_group, push_constant_data) = upload.draw_data(&target_texture);
let bytes = bytemuck::bytes_of(&push_constant_data); let bytes = bytemuck::bytes_of(&push_constant_data);
render_pass.set_bind_group(0, source_bind_group, &[]); render_pass.set_bind_group(0, source_bind_group, &[]);
render_pass.set_push_constants(wgpu::ShaderStage::VERTEX, 0, bytes); render_pass.set_push_constants(wgpu::ShaderStage::VERTEX, 0, bytes);
render_pass.draw(0..6, 0..1); render_pass.draw(0..6, 0..1);
} }
let avg_area = area as f32 / uploads.len() as f32;
tracing::info!("avg area sqrt {}", f32::sqrt(avg_area));
} }
} }

View File

@ -858,8 +858,6 @@ impl Default for PremultiplyLookupTable {
} }
fn premultiply_alpha(image: &mut RgbaImage) { fn premultiply_alpha(image: &mut RgbaImage) {
prof_span!("premultiply alpha");
lazy_static::lazy_static! { lazy_static::lazy_static! {
static ref LOOKUP: PremultiplyLookupTable = Default::default(); static ref LOOKUP: PremultiplyLookupTable = Default::default();
} }